n,m=map(int,input().split()) c=0 for i in range(n): s,r=input().split() r=int(r) c+=r>=1200 and ("x" in s[:4]) print(c)