import Data.Set (fromList)

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

solve :: Int -> [Int] -> String
solve n as = show . removeDup $ (x, n-x)
    where x = countDup as

removeDup :: (Int, Int) -> Int
removeDup (0, uni) = uni
removeDup (1, uni) = uni - 1
removeDup (x, uni) = removeDup (x-2, uni)

countDup :: [Int] -> Int
countDup as = abs $ length as - length (fromList as)
