import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int amountMonster;
        int PPspecatk;

        amountMonster = sc.nextInt();
        PPspecatk = sc.nextInt();

        List<Integer> HP = new ArrayList<>();
        for (int i = 0; i < amountMonster; i++) {
            HP.add(sc.nextInt());
        }
        Collections.sort(HP);

        long sum = 0;
        for (int i = 0; i < HP.size() - PPspecatk; i++) {
            sum += HP.get(i);
        }
        System.out.println(sum);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int amountMonster;
        int PPspecatk;

        amountMonster = sc.nextInt();
        PPspecatk = sc.nextInt();

        List<Integer> HP = new ArrayList<>();
        for (int i = 0; i < amountMonster; i++) {
            HP.add(sc.nextInt());
        }
        Collections.sort(HP);

        long sum = 0;
        for (int i = 0; i < HP.size() - PPspecatk; i++) {
            sum += HP.get(i);
        }
        System.out.println(sum);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int amountMonster;
        int PPspecatk;

        amountMonster = sc.nextInt();
        PPspecatk = sc.nextInt();

        List<Integer> HP = new ArrayList<>();
        for (int i = 0; i < amountMonster; i++) {
            HP.add(sc.nextInt());
        }
        Collections.sort(HP);

        long sum = 0;
        for (int i = 0; i < HP.size() - PPspecatk; i++) {
            sum += HP.get(i);
        }
        System.out.println(sum);
    } main {
        Scanner sc = new Scanner(System.in);

        int amountMonster;
        int PPspecatk;

        amountMonster = sc.nextInt();
        PPspecatk = sc.nextInt();

        List<Integer> HP = new ArrayList<>();
        for (int i = 0; i < amountMonster; i++) {
            HP.add(sc.nextInt());
        }
        Collections.sort(HP);

        long sum = 0;
        for (int i = 0; i < HP.size() - PPspecatk; i++) {
            sum += HP.get(i);
        }
        System.out.println(sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int amountMonster; amountMonster int PPspecatk; PPspecatk amountMonster = sc.nextInt() amountMonster sc.nextInt() sc.nextInt sc PPspecatk = sc.nextInt() PPspecatk sc.nextInt() sc.nextInt sc List<Integer> HP = new ArrayList<>(); HP new ArrayList<>() for (int i = 0; i < amountMonster; i++) {
            HP.add(sc.nextInt());
        } int i = 0; int i = 0; i 0 i < amountMonster i amountMonster i++ i++ i {
            HP.add(sc.nextInt());
        } {
            HP.add(sc.nextInt());
        } HP.add(sc.nextInt()) HP.add HP sc.nextInt() sc.nextInt sc Collections.sort(HP) Collections.sort Collections HP long sum = 0; sum 0 for (int i = 0; i < HP.size() - PPspecatk; i++) {
            sum += HP.get(i);
        } int i = 0; int i = 0; i 0 i < HP.size() - PPspecatk i HP.size() - PPspecatk HP.size() HP.size HP PPspecatk i++ i++ i {
            sum += HP.get(i);
        } {
            sum += HP.get(i);
        } sum += HP.get(i) sum HP.get(i) HP.get HP i System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int amountMonster;
        int PPspecatk;

        amountMonster = sc.nextInt();
        PPspecatk = sc.nextInt();

        List<Integer> HP = new ArrayList<>();
        for (int i = 0; i < amountMonster; i++) {
            HP.add(sc.nextInt());
        }
        Collections.sort(HP);

        long sum = 0;
        for (int i = 0; i < HP.size() - PPspecatk; i++) {
            sum += HP.get(i);
        }
        System.out.println(sum);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int amountMonster;
        int PPspecatk;

        amountMonster = sc.nextInt();
        PPspecatk = sc.nextInt();

        List<Integer> HP = new ArrayList<>();
        for (int i = 0; i < amountMonster; i++) {
            HP.add(sc.nextInt());
        }
        Collections.sort(HP);

        long sum = 0;
        for (int i = 0; i < HP.size() - PPspecatk; i++) {
            sum += HP.get(i);
        }
        System.out.println(sum);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int amountMonster;
        int PPspecatk;

        amountMonster = sc.nextInt();
        PPspecatk = sc.nextInt();

        List<Integer> HP = new ArrayList<>();
        for (int i = 0; i < amountMonster; i++) {
            HP.add(sc.nextInt());
        }
        Collections.sort(HP);

        long sum = 0;
        for (int i = 0; i < HP.size() - PPspecatk; i++) {
            sum += HP.get(i);
        }
        System.out.println(sum);
    }
}