#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; int N; int main() { cin >> N; int cnt = 0; for(int i = 0; i < N; ++i) { set st; for(int j = 0; j < 4; ++j) { string s; cin >> s; if(s == "akai" || s == "marui" || s == "okii" || s == "umai") { st.insert(s); } } if(st.size() == 4) cnt ++; } cout << cnt << endl; }