Scanf.scanf "%d" (fun n ->
    let l = Array.init (2 * n) (fun _ -> Scanf.scanf " %d" (fun l -> l)) in
    Array.sort compare l;
    let rec loop i acc =
        if i >= (2 * n) then acc else loop (i + 2) (acc + l.(i))
    in
    loop 0 0 |> Printf.printf "%d\n"
)