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.nextLong)
    //print(list)
    if (m <= n) println(0) else{
      val list2 = list.sorted
      //print(list)
      println(list.sorted.take(m-n).sum)
    }
  }
}
