N. N-ceratops
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

Max and his brother Min are two renowned scientists who dedicated their lives to the study of dinosaurs, especially the triceratops. After years of academic rivalry, the two came across something that would change everything: the fossilized skull of an $$$N$$$-ceratops, a distant relative of the triceratops.

Unable to contain their competitive spirit, the two made a bet on the number of spikes on the $$$N$$$-ceratops skull, and whoever got closer would have their name engraved on the fossil's plaque in the museum. To do so, they measured the height of each of the $$$M$$$ regions of the skull, and defined that a spike is a region that is taller than the regions to its left and to its right. More formally, a region $$$i$$$ $$$(2 \le i \le M-1)$$$ is a spike if $$$a_i \gt a_{i-1}$$$ and $$$a_i \gt a_{i+1}$$$.

Since Max and Min did not trust each other, they asked for your help to count the number of spikes. Given the heights of each region of the $$$N$$$-ceratops skull, report how many spikes it has.

Input

The first line contains a single integer $$$M$$$ $$$(3 \le M \le 10^5)$$$, the number of regions in the $$$N$$$-ceratops skull.

The second and last line contains $$$M$$$ integers $$$a_1, a_2, a_3, \ldots, a_M$$$ $$$(1 \le a_i \le 10^5)$$$, the heights of each region of the skull.

Output

Print a single integer, the number of spikes in the $$$N$$$-ceratops skull.

Examples
Input
7
1 5 2 10 2 6 1
Output
3
Input
10
1 2 1 2 1 2 1 2 1 2
Output
4