fun main(args: Array<String>) {
    val (n, k) = readLine()?.split(" ")?.map(String::toInt) ?: return
    val h = readLine()?.split(" ")?.map(String::toInt) ?: return
    var count = 0L
    h.sortedDescending().drop(k).forEach {
        count += it
    }
    println(count)
}
