import java.util.Arrays; import java.util.List; import java.util.Scanner; public class Main { private static List amaouPattern = Arrays.asList("akai", "marui", "okii", "umai"); public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int cnt = 0; for (int i = 0; i <= n; i++) { List strList = Arrays.stream(sc.nextLine().split(" ")).sorted().toList(); if(strList.equals(amaouPattern)) { cnt++; System.out.println(i); } } System.out.println(cnt); } }