ret = 0 N, M = map(int, input().split()) for _ in range(N): s, r = input().split() if int(r) >= 1200 and s[:4] != "oooo": ret += 1 print(ret)