'use strict'


function Main(input) {
  input = input.trim().split('\n')
  const array = input[0].split(' ').map(s => parseInt(s))

  const N = array[0]
  const K = array[1]
  const H = input[1].split(' ').map(s => parseInt(s))


  let a = H.sort((a, b) => b - a)
  a = a.slice(K)

  if(a.length < 1) {
    console.log(0)
    return
  }
  
  const res = a.reduce((p, c) => p + c)
  console.log(res)
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));