import Data.List (group, sort) getPowerUpNumber :: [Int] -> Int getPowerUpNumber xs = p1 + p2 where ys = map length $ group $ sort $ xs p1 = sum $ map (`div` 2) ys p2 = (`div` 4) $ sum $ map (`mod` 2) ys main :: IO () main = print . getPowerUpNumber . map read . drop 1 . words =<< getContents