import qualified Data.ByteString.Char8 as B
import Data.List

readInt :: B.ByteString -> Int
readInt = maybe undefined fst . B.readInt

readInts :: B.ByteString -> [Int]
readInts = map readInt . B.words

main = do
  n <- readLn
  as <- readInts <$> B.getLine
  print (eater n as)

eater n = (\x -> if odd x then n-(x+1) else n-x) . sum . map (pred . length) . group . sort