let () =
  let n = Scanf.scanf "%d\n" (fun n -> n) in
  let rec read_ss ss i =
    if i = n then
      ss
    else
      let value = Scanf.scanf "%d\n" (fun n -> n) in
      read_ss (value :: ss) (i + 1)
  in
  let x = read_ss [] 0 |> List.sort compare |> List.rev in
  (List.hd x / 2) :: List.tl x |> List.fold_left (+) 0 |>
  string_of_int |> print_endline

