a = int(input())
b = list(map(int, input().split()))
count = 0
if a == len(b):
  for i, b_c in enumerate(b):
    if (i == 0):
      count = count + 1
    else:
      if (b_c == max(b[i-1:i+2:1])):
          count = count + 1
print(count)