import Data.List

main = do
  getLine
  as<-map read.words<$>getLine :: IO [Int]
  print.solve $ as

solve as = length isEvens - if eval then 1 else 0
  where
  isEvens = map (even.length).group.sort $ as
  eval = odd.length.filter id $ isEvens