import Data.Array.IO
import Control.Monad

main = do
  getLine
  a <- return . (map (f . read)) . words =<< getLine

  arr <- newArray (0,8) 0 :: IO (IOArray Int Int)

  forM_ a $ \x -> do
    r <- readArray arr x
    writeArray arr x (r+1)

  putStrLn =<< return . unwords . (map show) . g =<< getElems arr

  where
    f n
      | n < 3200 = div n 400
      | otherwise = 8

    g xs = h c l
      where
        c = (length . (filter (/=0)) . init) xs
        l = last xs
        
    h c l
      | c == 0 = [1, if l>8 then 8 else l]
      | otherwise = [c, if c+l>8 then 8 else c+l]
