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