import java.util.*;
class Main{
	public static void main(String args[]){
    	Scanner s = new Scanner(System.in);
      	int numMonster = s.nextInt();
      	int numSpMoves = s.nextInt();
      	if(numSpMoves>numMonster){
      	    System.out.println("0");
      	    return;
      	}
      	List<Integer> monsterList = new ArrayList<Integer>(numMonster);
      	for(int i=0;i<numMonster;i++){
        	monsterList.add(s.nextInt());
        }
      	Collections.sort(monsterList);
      	for (int i=0;i<numSpMoves ;i++ ){
      	    monsterList.remove(numMonster-i-1);
      	} 
      	long numAttack = 0;
      	for(int i=0;i<monsterList.size();i++){
      	    numAttack+=monsterList.get(i);
      	}
      	System.out.println(numAttack);
    }
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz