let n, cs, e, s = read_int (), Array.make 100001 0, ref 0, ref 0
let _ = for _ = 1 to n do Scanf.scanf " %d" @@ fun a -> cs.(a) <- cs.(a) + 1 done; Array.iter (fun c -> if c > 1 then s := !s + if c mod 2 = 0 then (incr e; c / 2 - 1) else c / 2) cs; Printf.printf "%d\n" @@ n - 2 * (!s + (!e + 1) / 2)