import Control.Applicative
import Data.List

main = do
  _ <- getLine
  as <- sort . (map (read::String->Int)) . words <$> getLine

  print $ length (func as) - if even(length as - length (func as)) then 0 else 1

  where
    func [] = []
    func lst@(x:xs) = (x, len) : (func (drop len lst))
      where
        len = length (takeWhile (==x) lst)
  
