import Data.List

ans :: Integer -> [Integer] -> Integer
ans n card =
    let count :: [Integer] -> Integer
        count [] = 0
        count [_] = 0
        count (x:y:rest)
            | x == y = 1 + count rest
            | otherwise = count (y:rest)
        more_two = (*) 2 $ div (1 + count card) 2
        in n - more_two

main = print =<< ans <$> ((\a -> read a :: Integer) <$> getLine ) <*> ((sort . (map (\a -> read a :: Integer)) . words) <$> getLine)
