import java.util.Scanner;
import java.util.ArrayList;
import java.util.Collections;
class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> al = new ArrayList<Integer>();
    int N = sc.nextInt();
    int K = sc.nextInt();
    for(int i = 0;i < N;i++) {
      al.add(sc.nextInt());
    }
    Collections.sort(al,Collections.reverseOrder());
    Long turn = 0L;
    for(int i = 0;i < (N - K);i++) {
      turn += al.get(K + i);
    }
    System.out.println(turn);
  }
} import java.util.Scanner; Scanner java.util import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> al = new ArrayList<Integer>();
    int N = sc.nextInt();
    int K = sc.nextInt();
    for(int i = 0;i < N;i++) {
      al.add(sc.nextInt());
    }
    Collections.sort(al,Collections.reverseOrder());
    Long turn = 0L;
    for(int i = 0;i < (N - K);i++) {
      turn += al.get(K + i);
    }
    System.out.println(turn);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> al = new ArrayList<Integer>();
    int N = sc.nextInt();
    int K = sc.nextInt();
    for(int i = 0;i < N;i++) {
      al.add(sc.nextInt());
    }
    Collections.sort(al,Collections.reverseOrder());
    Long turn = 0L;
    for(int i = 0;i < (N - K);i++) {
      turn += al.get(K + i);
    }
    System.out.println(turn);
  } main {
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> al = new ArrayList<Integer>();
    int N = sc.nextInt();
    int K = sc.nextInt();
    for(int i = 0;i < N;i++) {
      al.add(sc.nextInt());
    }
    Collections.sort(al,Collections.reverseOrder());
    Long turn = 0L;
    for(int i = 0;i < (N - K);i++) {
      turn += al.get(K + i);
    }
    System.out.println(turn);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) ArrayList<Integer> al = new ArrayList<Integer>(); al new ArrayList<Integer>() int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc for(int i = 0;i < N;i++) {
      al.add(sc.nextInt());
    } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
      al.add(sc.nextInt());
    } {
      al.add(sc.nextInt());
    } al.add(sc.nextInt()) al.add al sc.nextInt() sc.nextInt sc Collections.sort(al,Collections.reverseOrder()) Collections.sort Collections al Collections.reverseOrder() Collections.reverseOrder Collections Long turn = 0L; turn 0L for(int i = 0;i < (N - K);i++) {
      turn += al.get(K + i);
    } int i = 0; int i = 0; i 0 i < (N - K) i (N - K) N K i++ i++ i {
      turn += al.get(K + i);
    } {
      turn += al.get(K + i);
    } turn += al.get(K + i) turn al.get(K + i) al.get al K + i K i System.out.println(turn) System.out.println System.out System System.out turn String[] args args
import java.util.Scanner;
import java.util.ArrayList;
import java.util.Collections;
class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> al = new ArrayList<Integer>();
    int N = sc.nextInt();
    int K = sc.nextInt();
    for(int i = 0;i < N;i++) {
      al.add(sc.nextInt());
    }
    Collections.sort(al,Collections.reverseOrder());
    Long turn = 0L;
    for(int i = 0;i < (N - K);i++) {
      turn += al.get(K + i);
    }
    System.out.println(turn);
  }
}