n,m=map(int,input().split()) ans=0 for i in range(n): s,t=input().split() if int(t)>=1200: for j in range(4): if s[j]=='x': ans+=1 break print(ans)