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);
    }
} import java.util.*; util.* java 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);
    }
} 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);
    } main {
    	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);
    } Scanner s = new Scanner(System.in); s new Scanner(System.in) int numMonster = s.nextInt(); numMonster s.nextInt() s.nextInt s int numSpMoves = s.nextInt(); numSpMoves s.nextInt() s.nextInt s if(numSpMoves>numMonster){
      	    System.out.println("0");
      	    return;
      	} numSpMoves>numMonster numSpMoves numMonster {
      	    System.out.println("0");
      	    return;
      	} System.out.println("0") System.out.println System.out System System.out "0" return; List<Integer> monsterList = new ArrayList<Integer>(numMonster); monsterList new ArrayList<Integer>(numMonster) for(int i=0;i<numMonster;i++){
        	monsterList.add(s.nextInt());
        } int i=0; int i=0; i 0 i<numMonster i numMonster i++ i++ i {
        	monsterList.add(s.nextInt());
        } {
        	monsterList.add(s.nextInt());
        } monsterList.add(s.nextInt()) monsterList.add monsterList s.nextInt() s.nextInt s Collections.sort(monsterList) Collections.sort Collections monsterList for (int i=0;i<numSpMoves ;i++ ){
      	    monsterList.remove(numMonster-i-1);
      	} int i=0; int i=0; i 0 i<numSpMoves i numSpMoves i++ i++ i {
      	    monsterList.remove(numMonster-i-1);
      	} {
      	    monsterList.remove(numMonster-i-1);
      	} monsterList.remove(numMonster-i-1) monsterList.remove monsterList numMonster-i-1 numMonster-i-1 numMonster i 1 long numAttack = 0; numAttack 0 for(int i=0;i<monsterList.size();i++){
      	    numAttack+=monsterList.get(i);
      	} int i=0; int i=0; i 0 i<monsterList.size() i monsterList.size() monsterList.size monsterList i++ i++ i {
      	    numAttack+=monsterList.get(i);
      	} {
      	    numAttack+=monsterList.get(i);
      	} numAttack+=monsterList.get(i) numAttack monsterList.get(i) monsterList.get monsterList i System.out.println(numAttack) System.out.println System.out System System.out numAttack String args[] args
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);
    }
}