#include using namespace std; using ll = long long; #define rep(i, n) for(int i = 0; i < n; i++) int main() { int N; cin >> N; vector> s(N); rep(i, N) { string w; rep(j, 4) { cin >> w; s[i].push_back(w); } } vector t{"akai", "marui", "okii", "umai"}; sort(t.begin(), t.end()); int ans = 0; rep(i, N) { sort(s[i].begin(), s[i].end()); if(s[i] == t) ans++; } cout << ans << endl; }