#include using namespace std; #define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; template using V=vector; template using VV=V>; //B(n,V(n)) int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); int cnt=0; V A={"akai","marui","okii","umai"}; int n; cin>>n; rep(i,n){ V B(4); rep(j,4){ string s; cin>>s; rep(k,4){ if(s==A[k]){ B[k]=1; break; } } } bool b=true; rep(j,4) if(B[j]==0) b=false; if(b) cnt++; } cout<