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

public class Main {

  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
    int n = input.nextInt();
    int k = input.nextInt();
    int[] xyz = new int[n];
    for (int i = 0; i < n; i++) {
      xyz[i] = input.nextInt();
    }
    Arrays.sort(xyz);
    long ans = 0;
    for (int i = n - k - 1; i >= 0; i--) {
      ans += xyz[i];
    }
    System.out.print(ans);
  }

} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
    int n = input.nextInt();
    int k = input.nextInt();
    int[] xyz = new int[n];
    for (int i = 0; i < n; i++) {
      xyz[i] = input.nextInt();
    }
    Arrays.sort(xyz);
    long ans = 0;
    for (int i = n - k - 1; i >= 0; i--) {
      ans += xyz[i];
    }
    System.out.print(ans);
  }

} Main public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
    int n = input.nextInt();
    int k = input.nextInt();
    int[] xyz = new int[n];
    for (int i = 0; i < n; i++) {
      xyz[i] = input.nextInt();
    }
    Arrays.sort(xyz);
    long ans = 0;
    for (int i = n - k - 1; i >= 0; i--) {
      ans += xyz[i];
    }
    System.out.print(ans);
  } main {
    Scanner input = new Scanner(System.in);
    int n = input.nextInt();
    int k = input.nextInt();
    int[] xyz = new int[n];
    for (int i = 0; i < n; i++) {
      xyz[i] = input.nextInt();
    }
    Arrays.sort(xyz);
    long ans = 0;
    for (int i = n - k - 1; i >= 0; i--) {
      ans += xyz[i];
    }
    System.out.print(ans);
  } Scanner input = new Scanner(System.in); input new Scanner(System.in) int n = input.nextInt(); n input.nextInt() input.nextInt input int k = input.nextInt(); k input.nextInt() input.nextInt input int[] xyz = new int[n]; xyz new int[n] n for (int i = 0; i < n; i++) {
      xyz[i] = input.nextInt();
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      xyz[i] = input.nextInt();
    } {
      xyz[i] = input.nextInt();
    } xyz[i] = input.nextInt() xyz[i] xyz i input.nextInt() input.nextInt input Arrays.sort(xyz) Arrays.sort Arrays xyz long ans = 0; ans 0 for (int i = n - k - 1; i >= 0; i--) {
      ans += xyz[i];
    } int i = n - k - 1; int i = n - k - 1; i n - k - 1 n - k - 1 n k 1 i >= 0 i 0 i-- i-- i {
      ans += xyz[i];
    } {
      ans += xyz[i];
    } ans += xyz[i] ans xyz[i] xyz i System.out.print(ans) System.out.print System.out System System.out ans String[] args args public class Main {

  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
    int n = input.nextInt();
    int k = input.nextInt();
    int[] xyz = new int[n];
    for (int i = 0; i < n; i++) {
      xyz[i] = input.nextInt();
    }
    Arrays.sort(xyz);
    long ans = 0;
    for (int i = n - k - 1; i >= 0; i--) {
      ans += xyz[i];
    }
    System.out.print(ans);
  }

} public class Main {

  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
    int n = input.nextInt();
    int k = input.nextInt();
    int[] xyz = new int[n];
    for (int i = 0; i < n; i++) {
      xyz[i] = input.nextInt();
    }
    Arrays.sort(xyz);
    long ans = 0;
    for (int i = n - k - 1; i >= 0; i--) {
      ans += xyz[i];
    }
    System.out.print(ans);
  }

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

public class Main {

  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
    int n = input.nextInt();
    int k = input.nextInt();
    int[] xyz = new int[n];
    for (int i = 0; i < n; i++) {
      xyz[i] = input.nextInt();
    }
    Arrays.sort(xyz);
    long ans = 0;
    for (int i = n - k - 1; i >= 0; i--) {
      ans += xyz[i];
    }
    System.out.print(ans);
  }

}
