#include using namespace std; #if __cplusplus < 202002L template int ssize(const T& a){ return a.size(); } #endif template istream& operator>> (istream& in, pair & a){ in >> a.first >> a.second; return in; } template istream& operator>> (istream& in, vector & a){ for (auto &x: a){ in >> x; } return in; } using ll = long long; using ld = long double; signed main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); if (fopen("KEK.inp", "r")){ freopen("KEK.inp", "r", stdin); freopen("KEK.out", "w", stdout); } vector a = {"akai", "marui", "okii", "umai"}; int n; cin >> n; int ans = 0; while (n--){ vector b(4); cin >> b; sort(begin(b), end(b)); if (a == b){ ans++; } } cout << ans << "\n"; }