let () = Scanf.scanf "%d\n" @@ fun n ->
  let ps = Array.init n @@ fun _ -> Scanf.scanf "%d\n" @@ fun p -> p in
  Printf.printf "%d\n" @@
  Array.fold_left ( + ) 0 ps - (Array.fold_left max min_int ps + 1) / 2
