import java.util.*

fun main(args:Array<String>){
    val (n,k) = readLine()!!.split(" ").map{it.toInt()}
    val a = readLine()!!.split(" ").map{it.toLong()}.sorted()
    var ans = 0L
    for(i in 0 until n - k){
        ans += a[i]
    }
    println(ans)
}
