import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int amaouCount = 0; for (int i = 0; i < N; i++) { String[] features = new String[4]; for (int j = 0; j < 4; j++) { features[j] = sc.next(); } if (containsAllFeatures(features)) { amaouCount++; } } System.out.println(amaouCount); } private static boolean containsAllFeatures(String[] features) { boolean akai = false, marui = false, okii = false, umai = false; for (String feature : features) { switch (feature) { case "akai": akai = true; break; case "marui": marui = true; break; case "okii": okii = true; break; case "umai": umai = true; break; } } return akai && marui && okii && umai; } }