let split_nums str =
  Str.split (Str.regexp " ") str
  |> List.map int_of_string

let odd_indexed xs =
  let os, es = List.fold_left (fun (l,r) x -> x :: r, l) ([], []) xs
  in es

let sum_list = List.fold_left (+) 0
       
let answer xs =
  List.sort (-) xs
  |> odd_indexed
  |> sum_list

let () =
  let _ = read_int () in
  read_line ()
  |> split_nums
  |> answer
  |> Printf.printf "%d\n";
