n = int(input()) g = 0 for _ in range(n): l = list(map(int,input().split())) s = l[0] + l[1] +l[2] a = s / 3 if a < 60: g = g + 1 print(g)