(n,m),*e=[s.split()for s in open(0)] ans=0 for s,r in e: if int(r)>=1200 and 'x'in s[:4]: ans+=1 print(ans)