#include using namespace std; int main() { int N; cin >> N; vector A(N, vector(4, ""s)); for(int i = 0; i < N; i++) cin >> A[i][0] >> A[i][1] >> A[i][2] >> A[i][3]; for(int i = 0; i < N; i++) ranges::sort(A[i]); vector B({"akai"s, "marui"s, "okii"s, "umai"s}); int ans(0); for(int i = 0; i < N; i++) if(A[i] == B) ans++; cout << ans << endl; return 0; }