No.2714 Amaou
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Show the original
Problem Statement
Strawberry farmer ecottea has harvested $N$ strawberries. The characteristics of the $i$-th strawberry are represented by $4$ strings $S_{i,1}, S_{i,2}, S_{i,3}, S_{i,4}$. The $i$-th strawberry is an Amaou if and only if these strings contain each of akai, marui, okii, and umai exactly $1$ time, in any order.
Find how many of the $N$ strawberries are Amaou.
Constraints
- $1 \leq N \leq 100$
- $N$ is an integer.
- $S_{i,j}$ is a string of length between $1$ and $5$, inclusive, consisting only of lowercase English letters.
Input
The input is given from Standard Input in the following format.
$N$
$S_{1,1} \ S_{1,2} \ S_{1,3} \ S_{1,4}$
$\vdots$
$S_{N,1} \ S_{N,2} \ S_{N,3} \ S_{N,4}$
Output
Output the answer. Print a newline at the end.
Sample
Sample 1
Input
4 akai marui okii umai okii marui umai akai amai marui oishi umai umai umai umai umai
Output
2
The $1$-st strawberry is an Amaou since $S_{1,1}=$akai, $S_{1,2}=$marui, $S_{1,3}=$okii, $S_{1,4}=$umai.
The $2$-nd strawberry is an Amaou since $S_{2,4}=$akai, $S_{2,2}=$marui, $S_{2,1}=$okii, $S_{2,3}=$umai.
The $3$-rd strawberry is not an Amaou since there is no $i$ such that $S_{3,i}=$akai.
The $4$-th strawberry is not an Amaou since there are $2$ or more values of $i$ such that $S_{4,i}=$umai.
Sample 2
Input
2 akai marui ookii umai akai marui oki umai
Output
0
Be careful with the spelling of okii.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
hamamu