local n = io.read("*n")
local t = {}
for i = 1, n do
  local a = io.read("*n")
  if t[a] then
    t[a] = t[a] + 1
    if t[a] == 3 then t[a] = 1 end
  else
    t[a] = 1
  end
end
local num2 = 0
local rem = 0
for k, v in pairs(t) do
  if v == 2 then num2 = num2 + 1 end
  rem = rem + 1
end
if num2 % 2 == 0 then
  print(rem)
else
  print(rem - 1)
end
