let n = read_int()
let arr = Array.make 100001 true
let rec f i k =
  if i = n then print_int (k - 1 + k mod 2)
  else
    let a = Scanf.scanf " %d" (fun a -> a) in
    if arr.(a) then (arr.(a) <- false; f (i + 1) (k + 1))
    else f (i + 1) k
let () = f 0 0