import Data.Set (fromList)

main :: IO ()
main = do
    l1 <- getLine
    l2 <- getLine
    let n = read l1
    let as = (map read . words) l2 :: [Int]
    putStrLn $ solve n as

solve :: Int -> [Int] -> String
solve n as = show . countRemain $ (dup, uniq)
    where
        uniq = length $ fromList as
        dup = n - uniq

countRemain :: (Int, Int) -> Int
countRemain (dup, uniq)
    | dup `mod` 2 == 0  = uniq
    | otherwise         = uniq - 1
