import qualified Data.ByteString.Char8 as C
import Data.List
import qualified Data.Vector.Unboxed as V

main = C.interact $ put . sol . get

get = V.tail . V.unfoldr (C.readInt . C.dropWhile (<'0'))

put = C.pack . unwords . fmap show

sol v = [n0, min 8 (n0+n1)]
  where
  (c0,c1) = V.partition (<8) $ V.map (`div` 400) v
  z0 = V.replicate 8 0 :: V.Vector Int
  p0 = V.zip c0 (V.replicate (V.length c0) 1 :: V.Vector Int)
  a0 = V.unsafeAccumulate (+) z0 p0
  n0 = V.length (V.filter (>0) a0)
  n1 = V.length c1