import Data.List
main = do
  getLine
  s <- getLine
  let ass = group $ sort $ words s
      x = length ass
      y = sum [1 | as <- ass, length as `mod` 2 == 0]
  print $ if y `mod` 2 == 0 then x else x - 1