N,M=map(int,input().split()) c=0 for _ in range(N): r,s=input().split() if 'x' in r[:4] and int(s)>=1200: c+=1 print(c)