N,M=map(int,input().split()) 気絶者=0 for _ in range(N): S,R=input().split() ; R=int(R) if S[:4]!="oooo" and 1200<=R : 気絶者+=1 print(気絶者)