import Data.List main :: IO () main = interact $ show . length . filter (==1) . map length . group . sort . map (read :: String -> Int) . words