import Control.Applicative
import Data.List(sort, groupBy)

main :: IO ()
main = do
  num <- getLine
  ls <- getNums <$> getLine
  let a = length $ groupBy (==) ls
  putStrLn $ show $ if (a `mod` 2 == 0)
                  then a - 1
                  else a

getNums :: String -> [Int]
getNums = map read . words
