Problem

9 /21


Elements that are larger than their neighbors

Problem

You are given an array of integers. Write a program that will determine the number of elements in the given array that have two adjacent elements and and they both are less than the given one.


Input
First given number N — the number of elements in the array (1<=N<=100). The  N numbers — array elements. The array consists of integers.
 
Output
It is necessary to display the number of array elements that have two neighbors and are strictly greater than both of their neighbors.
 
Examples
# Input Output
1 5
1 2 3 4 5
0
2 5
1 5 1 5 1
2