a = int(input())

n = 0
for i in range(1,a+1):
    score = map(int,input().split())
    average = sum(score) / 3

    if average < 60:
        n += 1

print(n)