#include using namespace std; using ll = long long; using vl = vector; using vb = vector; #define REP(i, s, n) for (int i = (int)(s); i < (int)(n); i++) #define PER(i, n, s) for (int i = (int)(n)-1; i >= (int)(s); i--) #define INT(n) int n;cin>>n; #define LL(n) long long n;cin>>n; #define STR(s) string s;cin>>s; #define VLL(a, n) vectora(n);for(int i=0;i<(int)(n);i++){cin>>a[i];} #define VSTR(a, n) vectora(n);for(int i=0;i<(int)(n);i++){cin>>a[i];} int main() { LL(n); vectors(4); vector amaou={"akai","marui","okii","umai"}; sort(amaou.begin(),amaou.end()); ll cnt=0; REP(i,0,n) { REP(j,0,4)cin>>s[j]; sort(s.begin(),s.end()); if(s==amaou)cnt++; } cout<