import java.util.*;
class Main{
  public static void main(String [] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    long[] HP = new long[N];
    for(int i=0; i < N; i++){
      HP[i]= sc.nextLong();
    }
    Arrays.sort(HP);
    long total = 0;
    int lim = (N<K)? 0 : N-K;
    for(int i = 0; i < lim; i++){
        total += HP[i];
    }
    System.out.print(total);
    
  }
} import java.util.*; util.* java class Main{
  public static void main(String [] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    long[] HP = new long[N];
    for(int i=0; i < N; i++){
      HP[i]= sc.nextLong();
    }
    Arrays.sort(HP);
    long total = 0;
    int lim = (N<K)? 0 : N-K;
    for(int i = 0; i < lim; i++){
        total += HP[i];
    }
    System.out.print(total);
    
  }
} Main public static void main(String [] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    long[] HP = new long[N];
    for(int i=0; i < N; i++){
      HP[i]= sc.nextLong();
    }
    Arrays.sort(HP);
    long total = 0;
    int lim = (N<K)? 0 : N-K;
    for(int i = 0; i < lim; i++){
        total += HP[i];
    }
    System.out.print(total);
    
  } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    long[] HP = new long[N];
    for(int i=0; i < N; i++){
      HP[i]= sc.nextLong();
    }
    Arrays.sort(HP);
    long total = 0;
    int lim = (N<K)? 0 : N-K;
    for(int i = 0; i < lim; i++){
        total += HP[i];
    }
    System.out.print(total);
    
  } 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 long[] HP = new long[N]; HP new long[N] N for(int i=0; i < N; i++){
      HP[i]= sc.nextLong();
    } int i=0; int i=0; i 0 i < N i N i++ i++ i {
      HP[i]= sc.nextLong();
    } {
      HP[i]= sc.nextLong();
    } HP[i]= sc.nextLong() HP[i] HP i sc.nextLong() sc.nextLong sc Arrays.sort(HP) Arrays.sort Arrays HP long total = 0; total 0 int lim = (N<K)? 0 : N-K; lim (N<K)? 0 : N-K (N<K) N K 0 N-K N K for(int i = 0; i < lim; i++){
        total += HP[i];
    } int i = 0; int i = 0; i 0 i < lim i lim i++ i++ i {
        total += HP[i];
    } {
        total += HP[i];
    } total += HP[i] total HP[i] HP i System.out.print(total) System.out.print System.out System System.out total String [] args args
import java.util.*;
class Main{
  public static void main(String [] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    long[] HP = new long[N];
    for(int i=0; i < N; i++){
      HP[i]= sc.nextLong();
    }
    Arrays.sort(HP);
    long total = 0;
    int lim = (N<K)? 0 : N-K;
    for(int i = 0; i < lim; i++){
        total += HP[i];
    }
    System.out.print(total);
    
  }
}