import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

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

        int n = stdIn.nextInt();
        int k = stdIn.nextInt();
        ArrayList<Long> hitPoint = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            hitPoint.add(stdIn.nextLong());
        }

        Collections.sort(hitPoint);

        long attack = 0;
        for (int i = 0; i < n - k; i++) {
            attack += hitPoint.get(i);
        }

        System.out.println(attack);
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);

        int n = stdIn.nextInt();
        int k = stdIn.nextInt();
        ArrayList<Long> hitPoint = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            hitPoint.add(stdIn.nextLong());
        }

        Collections.sort(hitPoint);

        long attack = 0;
        for (int i = 0; i < n - k; i++) {
            attack += hitPoint.get(i);
        }

        System.out.println(attack);
    }
} Main public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);

        int n = stdIn.nextInt();
        int k = stdIn.nextInt();
        ArrayList<Long> hitPoint = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            hitPoint.add(stdIn.nextLong());
        }

        Collections.sort(hitPoint);

        long attack = 0;
        for (int i = 0; i < n - k; i++) {
            attack += hitPoint.get(i);
        }

        System.out.println(attack);
    } main {
        Scanner stdIn = new Scanner(System.in);

        int n = stdIn.nextInt();
        int k = stdIn.nextInt();
        ArrayList<Long> hitPoint = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            hitPoint.add(stdIn.nextLong());
        }

        Collections.sort(hitPoint);

        long attack = 0;
        for (int i = 0; i < n - k; i++) {
            attack += hitPoint.get(i);
        }

        System.out.println(attack);
    } Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int n = stdIn.nextInt(); n stdIn.nextInt() stdIn.nextInt stdIn int k = stdIn.nextInt(); k stdIn.nextInt() stdIn.nextInt stdIn ArrayList<Long> hitPoint = new ArrayList<>(); hitPoint new ArrayList<>() for (int i = 0; i < n; i++) {
            hitPoint.add(stdIn.nextLong());
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            hitPoint.add(stdIn.nextLong());
        } {
            hitPoint.add(stdIn.nextLong());
        } hitPoint.add(stdIn.nextLong()) hitPoint.add hitPoint stdIn.nextLong() stdIn.nextLong stdIn Collections.sort(hitPoint) Collections.sort Collections hitPoint long attack = 0; attack 0 for (int i = 0; i < n - k; i++) {
            attack += hitPoint.get(i);
        } int i = 0; int i = 0; i 0 i < n - k i n - k n k i++ i++ i {
            attack += hitPoint.get(i);
        } {
            attack += hitPoint.get(i);
        } attack += hitPoint.get(i) attack hitPoint.get(i) hitPoint.get hitPoint i System.out.println(attack) System.out.println System.out System System.out attack String[] args args
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

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

        int n = stdIn.nextInt();
        int k = stdIn.nextInt();
        ArrayList<Long> hitPoint = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            hitPoint.add(stdIn.nextLong());
        }

        Collections.sort(hitPoint);

        long attack = 0;
        for (int i = 0; i < n - k; i++) {
            attack += hitPoint.get(i);
        }

        System.out.println(attack);
    }
}
