import java.util.*

fun main(args: Array<String>) {
    val scan = Scanner(System.`in`)
    val aa = scan.nextLine().split(" ").map{ it.trim().toInt() }.toTypedArray()
    var ab  = scan.nextLine().split(" ").map{ it.trim().toInt() }.toTypedArray()
    var n=aa[0]
    var k= aa[1]

    ab=ab.sortedDescending().toTypedArray()

    for(i in 0..k-1)
    {
        if(i<=ab.size-1)
            ab[i]=0
    }
    var z : Long = 0
    for(x in ab)
        z+=x
    print(z)
}
