let () =
  Scanf.scanf "%d" @@ fun n ->
  Array.init n (fun _ -> Scanf.scanf " %d" ((+) 0)) |> Array.to_list
  |> List.sort_uniq (-) |> List.length
  |> fun l -> Printf.printf "%d\n" (l - (l+1) mod 2)