N , M = map( int , input().split() ) res = 0 for i in range(N) : S = list( map( str , input().split() ) ) if int( S[1] ) >= 1200 : L = list(S[0]) if L[0] == "x" or L[1] == "x" or L[2] == "x" or L[3] == "x" : res += 1 print( res )