import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    long sum = 0;
    int k = scan.nextInt();

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

    int [] a = new int[n];
    for (int i=0;i<n;i++){
      a[i] = scan.nextInt();
    }

    Arrays.sort(a);
    int p = n-k;
    for (int t = 0; t<p;t++){
      sum += a[t];
    }
    System.out.println(sum);
  
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    long sum = 0;
    int k = scan.nextInt();

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

    int [] a = new int[n];
    for (int i=0;i<n;i++){
      a[i] = scan.nextInt();
    }

    Arrays.sort(a);
    int p = n-k;
    for (int t = 0; t<p;t++){
      sum += a[t];
    }
    System.out.println(sum);
  
  }
} Main public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    long sum = 0;
    int k = scan.nextInt();

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

    int [] a = new int[n];
    for (int i=0;i<n;i++){
      a[i] = scan.nextInt();
    }

    Arrays.sort(a);
    int p = n-k;
    for (int t = 0; t<p;t++){
      sum += a[t];
    }
    System.out.println(sum);
  
  } main {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    long sum = 0;
    int k = scan.nextInt();

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

    int [] a = new int[n];
    for (int i=0;i<n;i++){
      a[i] = scan.nextInt();
    }

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

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

    int [] a = new int[n];
    for (int i=0;i<n;i++){
      a[i] = scan.nextInt();
    }

    Arrays.sort(a);
    int p = n-k;
    for (int t = 0; t<p;t++){
      sum += a[t];
    }
    System.out.println(sum);
  
  }
} public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    long sum = 0;
    int k = scan.nextInt();

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

    int [] a = new int[n];
    for (int i=0;i<n;i++){
      a[i] = scan.nextInt();
    }

    Arrays.sort(a);
    int p = n-k;
    for (int t = 0; t<p;t++){
      sum += a[t];
    }
    System.out.println(sum);
  
  }
} Main
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    long sum = 0;
    int k = scan.nextInt();

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

    int [] a = new int[n];
    for (int i=0;i<n;i++){
      a[i] = scan.nextInt();
    }

    Arrays.sort(a);
    int p = n-k;
    for (int t = 0; t<p;t++){
      sum += a[t];
    }
    System.out.println(sum);
  
  }
}
