#include using namespace std; using ll = long long; const int INF = 1e9 + 10; const ll INFL = 4e18; int main() { vector info = {"akai", "marui", "okii", "umai"}; sort(info.begin(), info.end()); 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 == info) { ans++; } } cout << ans << endl; }