import java.util.*

fun main(args: Array<String>) {
    val (N, K) = readLine()!!.split(" ").map { it.toInt() }
    val Hsum :Long = readLine()!!.split(" ")
        .map { it.toInt() }
        .sortedByDescending { it }
        .drop(K)
        .sumByLong { it.toLong() }
    println("$Hsum")
}

inline fun <T> Iterable<T>.sumByLong(selector: (T) -> Long): Long {
    var sum = 0L
    for (element in this) {
        sum += selector(element)
    }
    return sum
}