N,M=map(int,input().split()) result=0 for i in range(N): s,r=input().split() r=int(r) if r>=1200: c=0 for j in range(4): if s[j]=='x': c=1 result+=c print(result)