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