#include using namespace std; using ll = long long; using ld = long double; #ifdef LOCAL #include #else #define debug(...) void(0) #endif #include using namespace atcoder; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N; cin >> N; set S{"akai", "marui", "okii", "umai"}; int ans = 0; while(N--) { set T; for(int i = 0; i < 4; i++) { string t; cin >> t; T.emplace(t); } if(S == T) ans++; } cout << ans << endl; }