import Data.List
import Control.Monad
import qualified Data.IntSet as S

main=do
    n<-readLn::IO Int
    as<-map read.words<$>getLine::IO[Int]
    putStrLn.unwords.(\(s,c)->[show$S.size s, show$(min 8 $ S.size s + c)]).foldl' f (S.empty,0) $ as
--
f (st,c) a
    | a< 400 = (S.insert 0 st, c)
    | a< 800 = (S.insert 1 st, c)
    | a<1200 = (S.insert 2 st, c)
    | a<1600 = (S.insert 3 st, c)
    | a<2000 = (S.insert 4 st, c)
    | a<2400 = (S.insert 5 st, c)
    | a<2800 = (S.insert 6 st, c)
    | a<3200 = (S.insert 7 st, c)
    | True   = (st, c+1)
