open Printf
open Scanf

module L =
  struct
    include List
  
    let rec drop n = function
        [] -> []
      | h :: t when n > 0 -> drop (n - 1) t
      | l -> l

    let init n f =
      let rec loop x =
        if x = n then []
        else let y = f x in y :: loop (x + 1)
      in loop 0
  end

let id x = x

let flip f x y = f y x

let solve n k =
  L.fold_left (+) 0 @@ L.drop k @@ L.fast_sort (flip compare) @@ L.init n (fun _ -> scanf "%d " id)

let () =
  scanf "%d %d " solve |> printf "%d\n"
