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 += 1200 print(ans)