from collections import * from itertools import * from functools import * from heapq import * import sys,math # input = sys.stdin.readline N = int(input()) S = [set(list(input().split())) for _ in range(N)] X = set(['akai','marui','okii','umai']) print(sum(s==X for s in S))