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