f = open('input.txt', 'r') input = f.readlines() count = 0 for i in range(len(input)): input[i] = input[i].strip() input[i] = int(input[i]) for x in range(len(input) - 3): a = input[x] + input[x + 1] + input[x + 2] b = input[x + 1] + input[x + 2] + input[x + 3] if a < b: count += 1 print(count)