CF888A Local Extrema
Description
You are given an array $ a $ . Some element of this array $ a_{i} $ is a local minimum iff it is strictly less than both of its neighbours (that is, $ a_{i}a_{i+1} $ ). Since $ a_{1} $ and $ a_{n} $ have only one neighbour each, they are neither local minima nor local maxima.
An element is called a local extremum iff it is either local maximum or local minimum. Your task is to calculate the number of local extrema in the given array.
Input Format
N/A
Output Format
N/A