import java.util.*;

class Main {
    final Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    private void run() {
        int n = sc.nextInt();
        int k = sc.nextInt();
        List<Long> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list.add(sc.nextLong());
        }
        Collections.sort(list, Collections.reverseOrder());

        long sum = 0;
        for (int i = k; i < n; i++) {
            sum += list.get(i);
        }
        System.out.println(sum);
    }
} import java.util.*; util.* java class Main {
    final Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    private void run() {
        int n = sc.nextInt();
        int k = sc.nextInt();
        List<Long> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list.add(sc.nextLong());
        }
        Collections.sort(list, Collections.reverseOrder());

        long sum = 0;
        for (int i = k; i < n; i++) {
            sum += list.get(i);
        }
        System.out.println(sum);
    }
} Main final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args private void run() {
        int n = sc.nextInt();
        int k = sc.nextInt();
        List<Long> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list.add(sc.nextLong());
        }
        Collections.sort(list, Collections.reverseOrder());

        long sum = 0;
        for (int i = k; i < n; i++) {
            sum += list.get(i);
        }
        System.out.println(sum);
    } run {
        int n = sc.nextInt();
        int k = sc.nextInt();
        List<Long> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list.add(sc.nextLong());
        }
        Collections.sort(list, Collections.reverseOrder());

        long sum = 0;
        for (int i = k; i < n; i++) {
            sum += list.get(i);
        }
        System.out.println(sum);
    } int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc List<Long> list = new ArrayList<>(); list new ArrayList<>() for (int i = 0; i < n; i++) {
            list.add(sc.nextLong());
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            list.add(sc.nextLong());
        } {
            list.add(sc.nextLong());
        } list.add(sc.nextLong()) list.add list sc.nextLong() sc.nextLong sc Collections.sort(list, Collections.reverseOrder()) Collections.sort Collections list Collections.reverseOrder() Collections.reverseOrder Collections long sum = 0; sum 0 for (int i = k; i < n; i++) {
            sum += list.get(i);
        } int i = k; int i = k; i k i < n i n i++ i++ i {
            sum += list.get(i);
        } {
            sum += list.get(i);
        } sum += list.get(i) sum list.get(i) list.get list i System.out.println(sum) System.out.println System.out System System.out sum
import java.util.*;

class Main {
    final Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    private void run() {
        int n = sc.nextInt();
        int k = sc.nextInt();
        List<Long> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list.add(sc.nextLong());
        }
        Collections.sort(list, Collections.reverseOrder());

        long sum = 0;
        for (int i = k; i < n; i++) {
            sum += list.get(i);
        }
        System.out.println(sum);
    }
}
