import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    int N =sc.nextInt();
    int K =sc.nextInt();
    if(N<=K){System.out.println(0);}
    else{
    long M[] =new long[N];
    for(int i=0;i<N;i++){
      M[i]=sc.nextLong();}
    Arrays.sort(M);
    long x=0;
    for(int j=0;j<N-K;j++){
      x=x+M[j];}
    System.out.println(x);}
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    int N =sc.nextInt();
    int K =sc.nextInt();
    if(N<=K){System.out.println(0);}
    else{
    long M[] =new long[N];
    for(int i=0;i<N;i++){
      M[i]=sc.nextLong();}
    Arrays.sort(M);
    long x=0;
    for(int j=0;j<N-K;j++){
      x=x+M[j];}
    System.out.println(x);}
  }
} Main public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    int N =sc.nextInt();
    int K =sc.nextInt();
    if(N<=K){System.out.println(0);}
    else{
    long M[] =new long[N];
    for(int i=0;i<N;i++){
      M[i]=sc.nextLong();}
    Arrays.sort(M);
    long x=0;
    for(int j=0;j<N-K;j++){
      x=x+M[j];}
    System.out.println(x);}
  } main {
    Scanner sc =new Scanner(System.in);
    int N =sc.nextInt();
    int K =sc.nextInt();
    if(N<=K){System.out.println(0);}
    else{
    long M[] =new long[N];
    for(int i=0;i<N;i++){
      M[i]=sc.nextLong();}
    Arrays.sort(M);
    long x=0;
    for(int j=0;j<N-K;j++){
      x=x+M[j];}
    System.out.println(x);}
  } 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 if(N<=K){System.out.println(0);}
    else{
    long M[] =new long[N];
    for(int i=0;i<N;i++){
      M[i]=sc.nextLong();}
    Arrays.sort(M);
    long x=0;
    for(int j=0;j<N-K;j++){
      x=x+M[j];}
    System.out.println(x);} N<=K N K {System.out.println(0);} System.out.println(0) System.out.println System.out System System.out 0 {
    long M[] =new long[N];
    for(int i=0;i<N;i++){
      M[i]=sc.nextLong();}
    Arrays.sort(M);
    long x=0;
    for(int j=0;j<N-K;j++){
      x=x+M[j];}
    System.out.println(x);} long M[] =new long[N]; M new long[N] N for(int i=0;i<N;i++){
      M[i]=sc.nextLong();} int i=0; int i=0; i 0 i<N i N i++ i++ i {
      M[i]=sc.nextLong();} {
      M[i]=sc.nextLong();} M[i]=sc.nextLong() M[i] M i sc.nextLong() sc.nextLong sc Arrays.sort(M) Arrays.sort Arrays M long x=0; x 0 for(int j=0;j<N-K;j++){
      x=x+M[j];} int j=0; int j=0; j 0 j<N-K j N-K N K j++ j++ j {
      x=x+M[j];} {
      x=x+M[j];} x=x+M[j] x x+M[j] x M[j] M j System.out.println(x) System.out.println System.out System System.out x String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    int N =sc.nextInt();
    int K =sc.nextInt();
    if(N<=K){System.out.println(0);}
    else{
    long M[] =new long[N];
    for(int i=0;i<N;i++){
      M[i]=sc.nextLong();}
    Arrays.sort(M);
    long x=0;
    for(int j=0;j<N-K;j++){
      x=x+M[j];}
    System.out.println(x);}
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    int N =sc.nextInt();
    int K =sc.nextInt();
    if(N<=K){System.out.println(0);}
    else{
    long M[] =new long[N];
    for(int i=0;i<N;i++){
      M[i]=sc.nextLong();}
    Arrays.sort(M);
    long x=0;
    for(int j=0;j<N-K;j++){
      x=x+M[j];}
    System.out.println(x);}
  }
} Main
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    int N =sc.nextInt();
    int K =sc.nextInt();
    if(N<=K){System.out.println(0);}
    else{
    long M[] =new long[N];
    for(int i=0;i<N;i++){
      M[i]=sc.nextLong();}
    Arrays.sort(M);
    long x=0;
    for(int j=0;j<N-K;j++){
      x=x+M[j];}
    System.out.println(x);}
  }
}