import scala.io.StdIn._

object Main extends App {


  val Array(h,k) = readLine().split(" ").map(_.toInt)
  val H = readLine().split(" ").map(_.toLong)

  def solve() = {
    val sorted = H.sorted(Ordering[Long].reverse)
    sorted.drop(k).sum
  }

  println(solve())

}

