import Data.List main = getLine >> getContents >>= print . solve . concatMap (map read . words) . lines solve :: [Int] -> Int solve xs = a + div (length xs - a * 2) 4 where a = foldl (\acc x -> length x `div` 2 + acc) 0 . group $ sort xs