import Control.Monad
import qualified Data.Vector.Unboxed as VU
import qualified Data.Vector.Unboxed.Mutable as VUM
import qualified Data.ByteString.Char8 as BS
import Data.Char (isSpace)
import Data.List

main = do
  n <- readLn :: IO Int
  as <- VU.unfoldrN n (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine 
  let bucket = makeBuckets as n
  let (a,b) = solve bucket 1 (0,0)
  putStrLn $ show a ++ " " ++ show b

solve :: VU.Vector Int -> Int -> (Int,Int) -> (Int,Int)
solve vec n (a,b) 
  | n == 9 = (a,b+s')
  | otherwise = solve (VU.drop 400 vec) (n+1) (a+k,b+k)
    where 
      s = VU.sum $ VU.take 400 vec
      s' = VU.sum vec
      k = if s > 0 then 1 else 0

makeBuckets :: VU.Vector Int -> Int -> VU.Vector Int
makeBuckets xs n =
  VU.create $ do
    buckets <- VUM.replicate 4801 (0::Int)
    forM_ [0..n-1] $ \i -> do
      let rate = xs VU.! i
      v <- VUM.read buckets rate
      VUM.write buckets rate (v+1)
    return buckets