N,M=map(int,input().split()) cnt=0 for i in range(N): S,R=list(input().split()) if int(R)>=1200 and 'x' in S[:4]: cnt+=1 print(cnt)