output_description: Print the number of elements p_i (1 < i < n) that satisfy the condition.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      n
      p_1 p_2 ... p_n
attempt: _, p = open(0)
  p = p.split()
  print(sum(sorted(a)[1] == a[1] for a in zip(p, p[1:], p[2:])))
  
problem_description: Statement
  
  We have a permutation p = {p_1,\ p_2,\ ...,\ p_n} of {1,\ 2,\ ...,\ n}.
  
  Print the number of elements p_i (1 < i < n) that satisfy the following
  condition:
  
    * p_i is the second smallest number among the three numbers p_{i - 1}, p_i, and p_{i + 1}.
samples: [{"input": "5\n    1 3 5 4 2", "output": "2\n    \n\np_2 = 3 is the second smallest number among p_1 = 1, p_2 = 3, and p_3 = 5.\nAlso, p_4 = 4 is the second smallest number among p_3 = 5, p_4 = 4, and p_5 =\n2. These two elements satisfy the condition.\n\n* * *"}, {"input": "9\n    9 6 3 2 5 8 7 4 1", "output": "5"}]