import java.util.Scanner;
import java.util.Arrays;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    int[] health = new int[n];
    for(int i = 0; i < n; i++){
      health[i] = sc.nextInt();
    }
    Arrays.sort(health);
    Long total = 0L;
    for(int i = 0; i < n - k; i++){
      total += health[i];
    }
    System.out.println(total);
  }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    int[] health = new int[n];
    for(int i = 0; i < n; i++){
      health[i] = sc.nextInt();
    }
    Arrays.sort(health);
    Long total = 0L;
    for(int i = 0; i < n - k; i++){
      total += health[i];
    }
    System.out.println(total);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    int[] health = new int[n];
    for(int i = 0; i < n; i++){
      health[i] = sc.nextInt();
    }
    Arrays.sort(health);
    Long total = 0L;
    for(int i = 0; i < n - k; i++){
      total += health[i];
    }
    System.out.println(total);
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    int[] health = new int[n];
    for(int i = 0; i < n; i++){
      health[i] = sc.nextInt();
    }
    Arrays.sort(health);
    Long total = 0L;
    for(int i = 0; i < n - k; i++){
      total += health[i];
    }
    System.out.println(total);
  } 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 int[] health = new int[n]; health new int[n] n for(int i = 0; i < n; i++){
      health[i] = sc.nextInt();
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      health[i] = sc.nextInt();
    } {
      health[i] = sc.nextInt();
    } health[i] = sc.nextInt() health[i] health i sc.nextInt() sc.nextInt sc Arrays.sort(health) Arrays.sort Arrays health Long total = 0L; total 0L for(int i = 0; i < n - k; i++){
      total += health[i];
    } int i = 0; int i = 0; i 0 i < n - k i n - k n k i++ i++ i {
      total += health[i];
    } {
      total += health[i];
    } total += health[i] total health[i] health i System.out.println(total) System.out.println System.out System System.out total String[] args args
import java.util.Scanner;
import java.util.Arrays;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    int[] health = new int[n];
    for(int i = 0; i < n; i++){
      health[i] = sc.nextInt();
    }
    Arrays.sort(health);
    Long total = 0L;
    for(int i = 0; i < n - k; i++){
      total += health[i];
    }
    System.out.println(total);
  }
}