N, M = map(int, input().split()) SR = [list(input().split()) for _ in range(N)] ans = 0 for S, R in SR: R = int(R) if R < 1200: continue cnt = 0 for s in S[:4]: if s == "x": cnt += 1 if 1 <= cnt: ans += 1 print(ans)