import Data.List

main :: IO ()
main = do
  n <- readLn
  a <- sum . map (\s -> length s - 1) . group . sort . filter (/= ' ') <$> getLine
  print $ if a `mod` 2 == 0
    then n - a
    else n - a - 1
