n=int(input()) cnt=0 for i in range(n): S=set(input().split()) if S=={"akai","marui","okii","umai"}: cnt+=1 print(cnt)