#include #include int mem[] = {0, 0, 0}; int sum() { return mem[0] + mem[1] + mem[2]; } int main(void) { int count = 0; int curr; int prev = 0; int i = 0; while(scanf("%d\n", &curr) != EOF) { mem[i++ % 3] = curr; if (i > 3) { if (prev && sum() > prev) { count++; } prev = sum(); } i++; } printf("%d\n", count); return 0; }