n,m=map(int,input().split()) s=0 for i in range(n): _,r=input().split() s+=int(r)>1199>_[:4].count("x")>0 print(s)