import Control.Monad.ST import qualified Data.Vector as V import qualified Data.Vector.Mutable as MV solve :: [Int] -> Int solve xs = let v' = V.map (`divMod` 2) v in sum (V.map fst v') + sum (V.map snd v') `div` 4 where v :: V.Vector Int v = runST $ do v <- MV.replicate 10 0 mapM_ (\i -> MV.modify v succ (i-1)) xs V.freeze v main :: IO () main = do n <- readLn :: IO Int xs <- concatMap (map read . words) . lines <$> getContents :: IO [Int] print $ solve xs