#define _CRT_SECURE_NO_WARNINGS #include using namespace std; int main() { int n; cin >> n; int res = 0; // 1 つずつ調べる for (int i = 0; i < n; i++) { vector s(4); for (int j = 0; j < 4; j++) cin >> s[j]; int cnt = 0; for (int j = 0; j < 4; j++) if (s[j] == "akai") cnt++; if (cnt != 1) continue; cnt = 0; for (int j = 0; j < 4; j++) if (s[j] == "marui") cnt++; if (cnt != 1) continue; cnt = 0; for (int j = 0; j < 4; j++) if (s[j] == "okii") cnt++; if (cnt != 1) continue; cnt = 0; for (int j = 0; j < 4; j++) if (s[j] == "umai") cnt++; if (cnt != 1) continue; res++; } cout << res << endl; }