import Control.Applicative ((<$>))
import Data.List (sort,group)

main = do
  _ <- read <$> getLine :: IO Int
  as <- group.sort.map read.words <$> getLine :: IO [[Int]]
  let evenCnt = length $ filter even $ map length as
  print $ if even evenCnt then length as else length as - 1
