import Control.Applicative import Control.Monad import Data.List import Data.Maybe count x = length . filter (== x) main = do _ <- getLine a <- map read . words <$> getLine :: IO [Int] putStrLn $ (show . count 4) a ++ " " ++ (show . count 2) a