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