ABC132 B - Ordinary Number
https://atcoder.jp/contests/abc132/tasks/abc132_b
提出
code: python
n = int(input())
p = list(map(int, input().split()))
ans = 0
for i in range(1, n-1):
if (pi-1 < pi and pi < pi+1):
ans += 1
elif (pi+1 < pi and pi < pi-1):
ans += 1
print(ans)