{-# LANGUAGE ScopedTypeVariables #-}

import qualified Data.ByteString.Char8 as B
import qualified Data.Vector.Unboxed as VU
import qualified Data.Vector.Unboxed.Mutable as VUM
import Data.List
import Data.Char
import Control.Monad

solve vec (a, b) i
    | i == 9 = if VU.sum vec > 0 then (a, b + VU.sum vec) else (a, b)
    | VU.sum ts > 0 = solve ds (a + 1, b + 1) (i+1)
    | otherwise = solve ds (a, b) (i+1)
        where
            ts = VU.take 400 vec
            ds = VU.drop 400 vec
        
main = do
    n <- readLn :: IO Int
    (vec :: VUM.IOVector Int) <- VUM.replicate 4801 0
    xs <- VU.unfoldrN n (B.readInt . B.dropWhile isSpace) <$> B.getLine
    VU.forM_ xs $ \x -> do
        VUM.modify vec (+1) x
    vec' <- VU.unsafeFreeze vec
    let (a,b) = solve vec' (0, 0) 1
    putStr $ show (max a 1)
    putStr " "
    putStrLn $ show b