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();
    sc.nextLine();
    String tmp = sc.nextLine();
    String Spl[] = tmp.split(" ");
    Long A[] = new Long[N];
    for (int i=0;i<N;i++){
      A[i] = Long.parseLong(Spl[i]);
    }
    Arrays.sort(A,Comparator.reverseOrder());
    long ans = 0;
    for (int i=(K);i<N;i++){
      ans += A[i];
    }
    System.out.println(ans);
  }
} 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();
    sc.nextLine();
    String tmp = sc.nextLine();
    String Spl[] = tmp.split(" ");
    Long A[] = new Long[N];
    for (int i=0;i<N;i++){
      A[i] = Long.parseLong(Spl[i]);
    }
    Arrays.sort(A,Comparator.reverseOrder());
    long ans = 0;
    for (int i=(K);i<N;i++){
      ans += A[i];
    }
    System.out.println(ans);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    sc.nextLine();
    String tmp = sc.nextLine();
    String Spl[] = tmp.split(" ");
    Long A[] = new Long[N];
    for (int i=0;i<N;i++){
      A[i] = Long.parseLong(Spl[i]);
    }
    Arrays.sort(A,Comparator.reverseOrder());
    long ans = 0;
    for (int i=(K);i<N;i++){
      ans += A[i];
    }
    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    sc.nextLine();
    String tmp = sc.nextLine();
    String Spl[] = tmp.split(" ");
    Long A[] = new Long[N];
    for (int i=0;i<N;i++){
      A[i] = Long.parseLong(Spl[i]);
    }
    Arrays.sort(A,Comparator.reverseOrder());
    long ans = 0;
    for (int i=(K);i<N;i++){
      ans += A[i];
    }
    System.out.println(ans);
  } 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 sc.nextLine() sc.nextLine sc String tmp = sc.nextLine(); tmp sc.nextLine() sc.nextLine sc String Spl[] = tmp.split(" "); Spl tmp.split(" ") tmp.split tmp " " Long A[] = new Long[N]; A new Long[N] N for (int i=0;i<N;i++){
      A[i] = Long.parseLong(Spl[i]);
    } int i=0; int i=0; i 0 i<N i N i++ i++ i {
      A[i] = Long.parseLong(Spl[i]);
    } {
      A[i] = Long.parseLong(Spl[i]);
    } A[i] = Long.parseLong(Spl[i]) A[i] A i Long.parseLong(Spl[i]) Long.parseLong Long Spl[i] Spl i Arrays.sort(A,Comparator.reverseOrder()) Arrays.sort Arrays A Comparator.reverseOrder() Comparator.reverseOrder Comparator long ans = 0; ans 0 for (int i=(K);i<N;i++){
      ans += A[i];
    } int i=(K); int i=(K); i (K) i<N i N i++ i++ i {
      ans += A[i];
    } {
      ans += A[i];
    } ans += A[i] ans A[i] A i System.out.println(ans) System.out.println System.out System System.out ans 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();
    sc.nextLine();
    String tmp = sc.nextLine();
    String Spl[] = tmp.split(" ");
    Long A[] = new Long[N];
    for (int i=0;i<N;i++){
      A[i] = Long.parseLong(Spl[i]);
    }
    Arrays.sort(A,Comparator.reverseOrder());
    long ans = 0;
    for (int i=(K);i<N;i++){
      ans += A[i];
    }
    System.out.println(ans);
  }
}
