local read = setmetatable({}, {__index = function(t, k) local a = {} for i=1,#k do table.insert(a, '*'..string.sub(k, i, i)) end local r = io.read local u = table.unpack or unpack return function() return r(u(a)) end end})
read.N = function(N) local t={} for i=1,N do t[i]=read.n() end return t end
--
local N = read.n()
local A = read.N(N)
local t = {}
for i,a in ipairs(A) do
    t[a] = (t[a] or 0) + 1
end
local garbage = 0
for _,v in pairs(t) do
    garbage = garbage + v - 1
end
local sacrifice = garbage % 2
print(N - garbage - sacrifice)
