import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
 
public class Main{
  public static void main(String args[]){
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt(); //モンスターの数
    int K = scan.nextInt(); //必殺技の回数
    long[] H = new long[N+1];
    long MaxH = 0;

    for(int i=1; i<=N; i++) {
    	H[i] = scan.nextLong();
    }
    
    Arrays.sort(H);
    
    for(int i =1; i<=N-K; i++) {
    MaxH = MaxH + H[i];
    }
    System.out.println(MaxH);
  }
} import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util public class Main{
  public static void main(String args[]){
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt(); //モンスターの数
    int K = scan.nextInt(); //必殺技の回数
    long[] H = new long[N+1];
    long MaxH = 0;

    for(int i=1; i<=N; i++) {
    	H[i] = scan.nextLong();
    }
    
    Arrays.sort(H);
    
    for(int i =1; i<=N-K; i++) {
    MaxH = MaxH + H[i];
    }
    System.out.println(MaxH);
  }
} Main public static void main(String args[]){
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt(); //モンスターの数
    int K = scan.nextInt(); //必殺技の回数
    long[] H = new long[N+1];
    long MaxH = 0;

    for(int i=1; i<=N; i++) {
    	H[i] = scan.nextLong();
    }
    
    Arrays.sort(H);
    
    for(int i =1; i<=N-K; i++) {
    MaxH = MaxH + H[i];
    }
    System.out.println(MaxH);
  } main {
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt(); //モンスターの数
    int K = scan.nextInt(); //必殺技の回数
    long[] H = new long[N+1];
    long MaxH = 0;

    for(int i=1; i<=N; i++) {
    	H[i] = scan.nextLong();
    }
    
    Arrays.sort(H);
    
    for(int i =1; i<=N-K; i++) {
    MaxH = MaxH + H[i];
    }
    System.out.println(MaxH);
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan int K = scan.nextInt(); K scan.nextInt() scan.nextInt scan long[] H = new long[N+1]; H new long[N+1] N+1 N 1 long MaxH = 0; MaxH 0 for(int i=1; i<=N; i++) {
    	H[i] = scan.nextLong();
    } int i=1; int i=1; i 1 i<=N i N i++ i++ i {
    	H[i] = scan.nextLong();
    } {
    	H[i] = scan.nextLong();
    } H[i] = scan.nextLong() H[i] H i scan.nextLong() scan.nextLong scan Arrays.sort(H) Arrays.sort Arrays H for(int i =1; i<=N-K; i++) {
    MaxH = MaxH + H[i];
    } int i =1; int i =1; i 1 i<=N-K i N-K N K i++ i++ i {
    MaxH = MaxH + H[i];
    } {
    MaxH = MaxH + H[i];
    } MaxH = MaxH + H[i] MaxH MaxH + H[i] MaxH H[i] H i System.out.println(MaxH) System.out.println System.out System System.out MaxH String args[] args public class Main{
  public static void main(String args[]){
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt(); //モンスターの数
    int K = scan.nextInt(); //必殺技の回数
    long[] H = new long[N+1];
    long MaxH = 0;

    for(int i=1; i<=N; i++) {
    	H[i] = scan.nextLong();
    }
    
    Arrays.sort(H);
    
    for(int i =1; i<=N-K; i++) {
    MaxH = MaxH + H[i];
    }
    System.out.println(MaxH);
  }
} public class Main{
  public static void main(String args[]){
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt(); //モンスターの数
    int K = scan.nextInt(); //必殺技の回数
    long[] H = new long[N+1];
    long MaxH = 0;

    for(int i=1; i<=N; i++) {
    	H[i] = scan.nextLong();
    }
    
    Arrays.sort(H);
    
    for(int i =1; i<=N-K; i++) {
    MaxH = MaxH + H[i];
    }
    System.out.println(MaxH);
  }
} Main
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
 
public class Main{
  public static void main(String args[]){
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt(); //モンスターの数
    int K = scan.nextInt(); //必殺技の回数
    long[] H = new long[N+1];
    long MaxH = 0;

    for(int i=1; i<=N; i++) {
    	H[i] = scan.nextLong();
    }
    
    Arrays.sort(H);
    
    for(int i =1; i<=N-K; i++) {
    MaxH = MaxH + H[i];
    }
    System.out.println(MaxH);
  }
}