import Control.Applicative ((<$>), (<*>), (<*), (*>), (<$))
import Control.Monad
import Data.List

main :: IO ()
main = do
  solve <$> getl read <*> getl (map read . words) >>= print

solve :: Int -> [Int] -> Int
solve n xs
  | even (length $ filter (==2) ys) = length ys
  | otherwise = length ys - 1
  where
    ys = map (\l -> f (length l)) . group . sort $ xs
    f x | even x = 2
        | otherwise = 1

getl :: (String -> a) -> IO a
getl f = f <$> getLine
