#include using namespace std; const vector amaou = {"akai", "marui", "okii", "umai"}; int main () { int N; cin >> N; int ans = 0; for (int i = 0; i < N; i++) { vector S(4); for(int j = 0; j < 4; j++) cin >> S[j]; sort(S.begin(), S.end()); if (S == amaou) ans++; } cout << ans << endl; }