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();
    long h[] = new long[n];
    long count = 0;
    long sum = 0;

    for (int i = 0;i<n ;i++ ) {
      h[i] = sc.nextInt();
    }

    Arrays.sort(h);

    if (n<=k) {
      System.out.println(0);
      System.exit(0);
    }

    for (int i = 0;i<k;i++) {
      h[n-i-1]=0;
    }
    for (int i = 0;i<n ;i++ ) {
      sum += h[i];
    }

    System.out.println(sum);
  }
} 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();
    long h[] = new long[n];
    long count = 0;
    long sum = 0;

    for (int i = 0;i<n ;i++ ) {
      h[i] = sc.nextInt();
    }

    Arrays.sort(h);

    if (n<=k) {
      System.out.println(0);
      System.exit(0);
    }

    for (int i = 0;i<k;i++) {
      h[n-i-1]=0;
    }
    for (int i = 0;i<n ;i++ ) {
      sum += h[i];
    }

    System.out.println(sum);
  }
} Main public static void main(String[]args){
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    int k = sc.nextInt();
    long h[] = new long[n];
    long count = 0;
    long sum = 0;

    for (int i = 0;i<n ;i++ ) {
      h[i] = sc.nextInt();
    }

    Arrays.sort(h);

    if (n<=k) {
      System.out.println(0);
      System.exit(0);
    }

    for (int i = 0;i<k;i++) {
      h[n-i-1]=0;
    }
    for (int i = 0;i<n ;i++ ) {
      sum += h[i];
    }

    System.out.println(sum);
  } main {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    int k = sc.nextInt();
    long h[] = new long[n];
    long count = 0;
    long sum = 0;

    for (int i = 0;i<n ;i++ ) {
      h[i] = sc.nextInt();
    }

    Arrays.sort(h);

    if (n<=k) {
      System.out.println(0);
      System.exit(0);
    }

    for (int i = 0;i<k;i++) {
      h[n-i-1]=0;
    }
    for (int i = 0;i<n ;i++ ) {
      sum += h[i];
    }

    System.out.println(sum);
  } 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 h[] = new long[n]; h new long[n] n long count = 0; count 0 long sum = 0; sum 0 for (int i = 0;i<n ;i++ ) {
      h[i] = sc.nextInt();
    } int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
      h[i] = sc.nextInt();
    } {
      h[i] = sc.nextInt();
    } h[i] = sc.nextInt() h[i] h i sc.nextInt() sc.nextInt sc Arrays.sort(h) Arrays.sort Arrays h if (n<=k) {
      System.out.println(0);
      System.exit(0);
    } n<=k n k {
      System.out.println(0);
      System.exit(0);
    } System.out.println(0) System.out.println System.out System System.out 0 System.exit(0) System.exit System 0 for (int i = 0;i<k;i++) {
      h[n-i-1]=0;
    } int i = 0; int i = 0; i 0 i<k i k i++ i++ i {
      h[n-i-1]=0;
    } {
      h[n-i-1]=0;
    } h[n-i-1]=0 h[n-i-1] h n-i-1 n-i-1 n i 1 0 for (int i = 0;i<n ;i++ ) {
      sum += h[i];
    } int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
      sum += h[i];
    } {
      sum += h[i];
    } 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 sc = new Scanner(System.in);

    int n = sc.nextInt();
    int k = sc.nextInt();
    long h[] = new long[n];
    long count = 0;
    long sum = 0;

    for (int i = 0;i<n ;i++ ) {
      h[i] = sc.nextInt();
    }

    Arrays.sort(h);

    if (n<=k) {
      System.out.println(0);
      System.exit(0);
    }

    for (int i = 0;i<k;i++) {
      h[n-i-1]=0;
    }
    for (int i = 0;i<n ;i++ ) {
      sum += h[i];
    }

    System.out.println(sum);
  }
} public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    int k = sc.nextInt();
    long h[] = new long[n];
    long count = 0;
    long sum = 0;

    for (int i = 0;i<n ;i++ ) {
      h[i] = sc.nextInt();
    }

    Arrays.sort(h);

    if (n<=k) {
      System.out.println(0);
      System.exit(0);
    }

    for (int i = 0;i<k;i++) {
      h[n-i-1]=0;
    }
    for (int i = 0;i<n ;i++ ) {
      sum += h[i];
    }

    System.out.println(sum);
  }
} 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();
    long h[] = new long[n];
    long count = 0;
    long sum = 0;

    for (int i = 0;i<n ;i++ ) {
      h[i] = sc.nextInt();
    }

    Arrays.sort(h);

    if (n<=k) {
      System.out.println(0);
      System.exit(0);
    }

    for (int i = 0;i<k;i++) {
      h[n-i-1]=0;
    }
    for (int i = 0;i<n ;i++ ) {
      sum += h[i];
    }

    System.out.println(sum);
  }
}
