object Main extends App {
  val Array(n, k) = io.StdIn.readLine().split(' ').map(_.toInt)
  val hn = io.StdIn.readLine().split(' ').map(_.toInt).sorted(Ordering[Int].reverse)
  println(hn.drop(k).foldLeft(0: Long)((acc, x) => acc + x))
}