import Control.Monad import Data.List(sort) main :: IO () main = do n <- readLn solve <$> replicateM n f >>= print where f = words <$> getLine solve :: [[String]] -> Int solve = foldl f 0 where f ct l = if sort l == ["akai", "marui", "okii", "umai"] then ct + 1 else ct