import Data.List

main = do
    n <- readLn
    as <- getInts
    print $ solve n as

getInts :: IO [Int]
getInts = map read . words <$> getLine

solve :: Int -> [Int] -> Int
solve n as | odd (n-m) = m-1
           | otherwise = m
    where m = length $ group $ sort as
