Scanf.scanf "%d" (fun n ->
    let a = Array.init n (fun _ -> Scanf.scanf " %d" (fun a -> a)) in
    Array.sort compare a;
    let sum = Array.fold_left (+) 0 a in
    let sum = sum - a.(n - 1) / 2 in
    Printf.printf "%d\n" sum
)