import sys
L = [int(l[:-1]) for l in sys.stdin.readlines()]
print(sum([0,1][a<b] for (a,b) in zip(L, L[3:])))