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