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