object Main {
  import scala.math
  def main(args: Array[String]) {
    val sc = new java.util.Scanner(System.in)
    val m,n = sc.nextInt
    val list = List.fill(m)(sc.nextInt)
    //print(list)
    if (m <= n) println(0) else{
      val list2 = list.sorted
      //print(list)
      var answer:Long = 0
      for (i <- 0 to m-n-1){
        answer=answer+list2(i).toLong
      }
      println(answer)
    }
  }
}
