import Data.List (sort, group) calc :: [Int] -> [Int] calc xs | all (== h) xs = if l == 2 then [s, 0] else [0, s] | otherwise = reverse $ map length $ group $ sort xs where h = head xs s = length xs l = div h $ s - 1 main :: IO () main = getLine >> getLine >>= putStrLn . unwords . map show . calc . map read . words