import java.util.*
 
fun main(args: Array<String>) {
 
  val sc = Scanner(System.`in`)
  val numOfMonster = sc.nextInt()
  val numOfSpecialAttack = sc.nextInt()
  val arrayOfMonsterHP = ArrayList<Long>()
  (1..numOfMonster).forEach {
    val monsterHP = sc.nextInt()
    arrayOfMonsterHP.add(monsterHP.toLong())
  }
  
  if(numOfMonster <= numOfSpecialAttack) {
    println(0.toString())
    return
  }
  
  val arrayOfMonstersDescending = arrayOfMonsterHP.sortedDescending()
  val droped = arrayOfMonstersDescending.drop(numOfSpecialAttack)
  
  
  val reduced = droped.reduce { acc, value ->
     acc + value                            
  }
  
  println("$reduced")
}