import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)
  
  val n  = sc.nextInt
  val k  = sc.nextInt
  val hs = List.fill(n)(sc.nextLong)
  
  val res = hs.sorted.dropRight(k).sum
  
  println(res)
}