open Hashtbl
let n = read_int ()
let h, a_s = create n, Array.init n @@ fun _ -> Scanf.scanf " %d" (+) 0
let _ = Array.iter (fun a -> replace h a @@ try find h a + 1 with _ -> 1) a_s; length h - (fold (fun _ c s -> s + 1 - c mod 2) h 0) mod 2 |> Printf.printf "%d\n"