#include const std::string g[4] = {"akai", "marui", "okii", "umai"}; int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); int ans = 0; int N; std::cin >> N; for (int i = 0; i < N; i++) { std::map f; for (int j = 0; j < 4; j++) { std::string s; std::cin >> s; f[s] = 1; } int cnt = 0; for (int j = 0; j < 4; j++) { if (f[g[j]]) { cnt++; } } ans += cnt == 4; } std::cout << ans << '\n'; return 0; }