import java.util.*;
import java.lang.*;
import java.io.*;
// The main method must be in a class named "Main".
class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int[] arr=new int[n];
int count=0;
for(int i=0;i<n;i++){
arr[i]=sc.nextInt();
}
for(int i=1;i<n-1;i++){
if(arr[i]>arr[i-1] && arr[i]>arr[i+1]){
count++;
}
}
System.out.println(count);
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: