#include using namespace std; int main(){ int N; cin >> N; int ans = 0; while(N--){ string S[4]; for(auto &x : S) cin >> x; sort(S, S + 4); if(S[0] == "akai" && S[1] == "marui" && S[2] == "okii" && S[3] == "umai") ans++; } cout << ans << '\n'; }