import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); List> list = new ArrayList<>(); for (int i = 0; i < n; i++) { List list2 = new ArrayList<>(); for (int j = 0; j < 4; j++) { list2.add(sc.next()); } list.add(list2); } sc.close(); int ans = 0; for (int i = 0; i < n; i++) { List list2 = list.get(i); if (list2.contains("akai") && list2.contains("marui") && list2.contains("okii") && list2.contains("umai")) { ans++; } } System.out.println(ans); } }