n,v=int(input()),0 *l,=map(int,input().split()) for i in range(1,n-1): if l[i-1]!=l[i+1] and (l[i-1]l[i+1] or l[i-1]>l[i]