let rec f = function x::y::ys -> x + f ys | _ -> 0
let _ = Scanf.scanf "%d" @@ fun n ->
  Array.(init (2*n) (fun _ -> Scanf.scanf " %d" ((+) 0)) |> to_list)
  |> List.sort (-) |> f |> Printf.printf "%d\n"