n,m=map(int,input().split()) c=0 for _ in range(n): a,b=input().split() if int(b)>=1200 and 'x' in a[:4]: c+=1 print(c)