Skateboard
Den, a beginner skateboarder, is eager to ride his skateboard. However, the road he's chosen is quite bumpy, and due to his lack of experience, he struggles with hills. At the top of each hill, he inevitably falls and scrapes his knees. Aware of this, his girlfriend Kate, with a sigh, prepares antiseptic and tries to discourage Den from continuing his risky adventure, suspecting his motivations. Yet, Den is determined to complete the ride.
Kate wonders how many times she will need to come to Den's aid during this challenging journey.
Input
The first line contains the integer N - the number of bends in the road (3 ≤ N ≤ 1000). The following line contains N integers a_i (-1000 ≤ a_{i} ≤ 1000), representing the y-coordinates of the bends from left to right. The road between two consecutive bends is a straight segment connecting them. No two consecutive numbers are equal (a_1 < a_2, a_{N-1} > a_N).
Output
Output a single integer - the number of times Den falls.