#include using namespace std; #define rep(i, l, r) for (int i = (int)(l); i<(int)(r); i++) #define ll long long int main() { int N; cin >> N; int cnt = 0; rep(i, 0, N) { vector ok(4, false); string S[4]; rep(i, 0, 4) cin >> S[i]; rep(i, 0, 4) { if (S[i]=="akai") ok[0] = true; if (S[i]=="marui") ok[1] = true; if (S[i]=="okii") ok[2] = true; if (S[i]=="umai") ok[3] = true; } if (ok[0]+ok[1]+ok[2]+ok[3]==4) cnt++; } cout << cnt << endl; }