from collections import deque, defaultdict, Counter from bisect import bisect_left, bisect_right from itertools import permutations, combinations from functools import cache from more_itertools import distinct_permutations from heapq import heappop, heappush import math _int = lambda x: int(x)-1 MOD = 998244353 INF = 1<<60 Yes, No = "Yes", "No" N, M = map(int, input().split()) ans = 0 for _ in range(N): s, r = input().split() r = int(r) if r >= 1200: for i in range(4): if s[i] == "x": ans += 1 break print(ans)