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

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];
 int i=0;
  for(i=0;i<n;i++){
    h[i]=scan.nextLong();
  }
Arrays.sort(h);
long sum=0;
for(i=0;i<n-k;i++){
  sum=sum+h[i];
}

    System.out.println(sum);

}
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays 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];
 int i=0;
  for(i=0;i<n;i++){
    h[i]=scan.nextLong();
  }
Arrays.sort(h);
long sum=0;
for(i=0;i<n-k;i++){
  sum=sum+h[i];
}

    System.out.println(sum);

}
} 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];
 int i=0;
  for(i=0;i<n;i++){
    h[i]=scan.nextLong();
  }
Arrays.sort(h);
long sum=0;
for(i=0;i<n-k;i++){
  sum=sum+h[i];
}

    System.out.println(sum);

} main {
Scanner scan=new Scanner(System.in);

int n=scan.nextInt();
int k=scan.nextInt();
long[] h=new long[n];
 int i=0;
  for(i=0;i<n;i++){
    h[i]=scan.nextLong();
  }
Arrays.sort(h);
long sum=0;
for(i=0;i<n-k;i++){
  sum=sum+h[i];
}

    System.out.println(sum);

} 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]; h new long[n] n int i=0; i 0 for(i=0;i<n;i++){
    h[i]=scan.nextLong();
  } i=0; i=0 i 0 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 long sum=0; sum 0 for(i=0;i<n-k;i++){
  sum=sum+h[i];
} i=0; i=0 i 0 i<n-k i n-k n k i++ i++ i {
  sum=sum+h[i];
} {
  sum=sum+h[i];
} sum=sum+h[i] sum sum+h[i] sum h[i] h i System.out.println(sum) System.out.println System.out System System.out sum 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];
 int i=0;
  for(i=0;i<n;i++){
    h[i]=scan.nextLong();
  }
Arrays.sort(h);
long sum=0;
for(i=0;i<n-k;i++){
  sum=sum+h[i];
}

    System.out.println(sum);

}
} 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];
 int i=0;
  for(i=0;i<n;i++){
    h[i]=scan.nextLong();
  }
Arrays.sort(h);
long sum=0;
for(i=0;i<n-k;i++){
  sum=sum+h[i];
}

    System.out.println(sum);

}
} Main
import java.util.Scanner;
import java.util.Arrays;

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];
 int i=0;
  for(i=0;i<n;i++){
    h[i]=scan.nextLong();
  }
Arrays.sort(h);
long sum=0;
for(i=0;i<n-k;i++){
  sum=sum+h[i];
}

    System.out.println(sum);

}
}
