def count_amaou_strawberries(N, strawberries): amaou_count = 0 amaou_characteristics = {"akai", "marui", "okii", "umai"} for strawberry in strawberries: if set(strawberry) == amaou_characteristics: amaou_count += 1 return amaou_count N = int(input()) strawberries = [] for _ in range(N): strawberries.append(input().split()) amaou_count = count_amaou_strawberries(N, strawberries) print(amaou_count)