import java.util.Arrays;
import java.util.Scanner;

fun main (args : Array<String>) {
  val input = Scanner(System.`in`)
  
  while (input.hasNext()) {
    val N = input.nextInt()
    val K = input.nextInt()
    val H = IntArray(N)
    
    for (i in H.indices) {
      H[i] = input.nextInt()
    }
    
    Arrays.sort(H)
    
    var attackCount = 0L
    if (H.size > K) {
      for (i in 0..(H.size - K - 1)) {
        attackCount += H[i]
      }
    }
    
    println (attackCount)
  }
}