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