N, M = map(int, input().split()) ans = 0 for _ in range(N): S, R = input().split() if int(R) >= 1200 and S[:4].count('x') > 0: ans += 1 print(ans)