fun main(args:Array<String>) {
    val (n,k) = readLine()!!.split(" ").map { it.toInt() }
    val hp = readLine()!!.split(" ").map { it.toLong() }
    val sortedHp = hp.sortedDescending()
    println(sortedHp.drop(k).sum())

}