#!/usr/bin/env python3 import sys prev = None mem = [] count = 0 i = 0 for l in sys.stdin: curr = int(l.strip()) if len(mem) < 3: mem.append(curr) continue else: mem[i % 3] = curr i += 1 s = sum(mem) if prev and s > prev: count += 1 prev = s print(count)