Scanf.scanf "%d" (fun n ->
    let hist = Array.make 100001 0 in
    for i = 1 to n do
        Scanf.scanf " %d" (fun a -> hist.(a) <- hist.(a) + 1)
    done;
    let rec loop i odd even =
        if i = 0 then Printf.printf "%d\n" (odd + even - (even mod 2)) else
            let odd  = if hist.(i) mod 2 = 1                  then odd + 1 else odd  in
            let even = if hist.(i) mod 2 = 0 && hist.(i) > 0 then even + 1 else even in
            loop (i - 1) odd even
    in
    loop 100000 0 0
)