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