//Dev-C++ 5.11 (C)
#include
int main(void)
{int arr[100],n,k;
scanf("%d",&n);
k=0;
for(int i=0;i scanf("%d",&arr[i]);
for(int i=0;i if(i==0 && arr[i]>arr[i+1])k++;
else
if(i==n-1 && arr[i]>arr[i-1])k++;
else
if(arr[i]>arr[i-1] && arr[i]>arr[i+1])k++;
printf("%d",k);
return 0;}