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