import Data.List
import Control.Monad

solve xs = loop xs' 
    where
        xs' = map (\y@(a:_) -> (a,length y)) $ group $ sort $ map f xs
        loop [] acc = acc
        loop ((x, y):xs) (a, b)
            | x == 'x' && y == 1 = loop xs (a + 1, b + 1) 
            | x == 'x' && y >= 1 = loop xs (a + 1, b + y) 
            | otherwise = loop xs (a + 1, b + 1) 
        f x  
            | x `elem` [1..399] = 'a'
            | x `elem` [400..799] = 'b'
            | x `elem` [800..1199] = 'c'
            | x `elem` [1200..1599] = 'd'
            | x `elem` [1600..1999] = 'e'
            | x `elem` [2000..2399] = 'f'
            | x `elem` [2400..2799] = 'g'
            | otherwise = 'x'

main = do
    n <- readLn :: IO Int
    xs <- map read . words <$> getLine :: IO [Int]
    let (a, b) = solve xs (0, 0)
    putStr $ show a 
    putStr " "
    putStrLn $ show b