import java.util.Scanner;
import java.util.Arrays;

class Main {
  public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        int[] H = new int[N];
        for(int i = 0; i < N; i++) {
          H[i] = sc.nextInt();
          //System.out.println(H[i]);
        }
        Arrays.sort(H);
      	
        for(int i = 1; i <= K; i++) {
          if(N <= K) {
          	for(int j = 0; j < N; j++) {
          		H[j] = 0;  
        	}
            break;
          }
          H[N-i] = 0;
        }
    	
        long count = 0;
        for(int j = 0; j < N; j++) {
          count += H[j];  
        }
        System.out.println(count);
    }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util class Main {
  public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        int[] H = new int[N];
        for(int i = 0; i < N; i++) {
          H[i] = sc.nextInt();
          //System.out.println(H[i]);
        }
        Arrays.sort(H);
      	
        for(int i = 1; i <= K; i++) {
          if(N <= K) {
          	for(int j = 0; j < N; j++) {
          		H[j] = 0;  
        	}
            break;
          }
          H[N-i] = 0;
        }
    	
        long count = 0;
        for(int j = 0; j < N; j++) {
          count += H[j];  
        }
        System.out.println(count);
    }
} Main public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        int[] H = new int[N];
        for(int i = 0; i < N; i++) {
          H[i] = sc.nextInt();
          //System.out.println(H[i]);
        }
        Arrays.sort(H);
      	
        for(int i = 1; i <= K; i++) {
          if(N <= K) {
          	for(int j = 0; j < N; j++) {
          		H[j] = 0;  
        	}
            break;
          }
          H[N-i] = 0;
        }
    	
        long count = 0;
        for(int j = 0; j < N; j++) {
          count += H[j];  
        }
        System.out.println(count);
    } main {
      Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        int[] H = new int[N];
        for(int i = 0; i < N; i++) {
          H[i] = sc.nextInt();
          //System.out.println(H[i]);
        }
        Arrays.sort(H);
      	
        for(int i = 1; i <= K; i++) {
          if(N <= K) {
          	for(int j = 0; j < N; j++) {
          		H[j] = 0;  
        	}
            break;
          }
          H[N-i] = 0;
        }
    	
        long count = 0;
        for(int j = 0; j < N; j++) {
          count += H[j];  
        }
        System.out.println(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc int[] H = new int[N]; H new int[N] N for(int i = 0; i < N; i++) {
          H[i] = sc.nextInt();
          //System.out.println(H[i]);
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
          H[i] = sc.nextInt();
          //System.out.println(H[i]);
        } {
          H[i] = sc.nextInt();
          //System.out.println(H[i]);
        } H[i] = sc.nextInt() H[i] H i sc.nextInt() sc.nextInt sc Arrays.sort(H) Arrays.sort Arrays H for(int i = 1; i <= K; i++) {
          if(N <= K) {
          	for(int j = 0; j < N; j++) {
          		H[j] = 0;  
        	}
            break;
          }
          H[N-i] = 0;
        } int i = 1; int i = 1; i 1 i <= K i K i++ i++ i {
          if(N <= K) {
          	for(int j = 0; j < N; j++) {
          		H[j] = 0;  
        	}
            break;
          }
          H[N-i] = 0;
        } {
          if(N <= K) {
          	for(int j = 0; j < N; j++) {
          		H[j] = 0;  
        	}
            break;
          }
          H[N-i] = 0;
        } if(N <= K) {
          	for(int j = 0; j < N; j++) {
          		H[j] = 0;  
        	}
            break;
          } N <= K N K {
          	for(int j = 0; j < N; j++) {
          		H[j] = 0;  
        	}
            break;
          } for(int j = 0; j < N; j++) {
          		H[j] = 0;  
        	} int j = 0; int j = 0; j 0 j < N j N j++ j++ j {
          		H[j] = 0;  
        	} {
          		H[j] = 0;  
        	} H[j] = 0 H[j] H j 0 break; H[N-i] = 0 H[N-i] H N-i N i 0 long count = 0; count 0 for(int j = 0; j < N; j++) {
          count += H[j];  
        } int j = 0; int j = 0; j 0 j < N j N j++ j++ j {
          count += H[j];  
        } {
          count += H[j];  
        } count += H[j] count H[j] H j System.out.println(count) System.out.println System.out System System.out count String[] args args
import java.util.Scanner;
import java.util.Arrays;

class Main {
  public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        int[] H = new int[N];
        for(int i = 0; i < N; i++) {
          H[i] = sc.nextInt();
          //System.out.println(H[i]);
        }
        Arrays.sort(H);
      	
        for(int i = 1; i <= K; i++) {
          if(N <= K) {
          	for(int j = 0; j < N; j++) {
          		H[j] = 0;  
        	}
            break;
          }
          H[N-i] = 0;
        }
    	
        long count = 0;
        for(int j = 0; j < N; j++) {
          count += H[j];  
        }
        System.out.println(count);
    }
}