n = int(input())
count = 0
for _ in range(n):
    a,b,c = map(int,input().split())
    if (a + b + c) / 3 < 60:
        count += 1
print(count)