let cs, a_s = Array.(make 100001 0, init (read_int ()) @@ fun _ -> Scanf.scanf " %d" (+) 0)
let _ = Array.(iter (fun a -> cs.(a) <- cs.(a) + 1) a_s; List.(length @@ sort_uniq (-) @@ to_list a_s) - if (fold_left (fun s c -> if c > 0 && c mod 2 = 0 then s + 1 else s) 0 cs) mod 2 = 1 then 1 else 0) |> Printf.printf "%d\n"