import java.util.Arrays;
import java.util.Scanner;

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

            int n = Integer.valueOf(line[0]);
            int k = Integer.valueOf(line[1]);

            int aCnt = n - k;

            long result = 0;
            if (aCnt <= 0) {
                System.out.println(result);
                return;
            }

            long[] dList = new long[n];

            for(int i=0;i<n;i++){
                dList[i] = sc.nextInt();
            }
            Arrays.sort(dList);

            for (int i = 0; i < aCnt; i++) {
                result += dList[i];
            }

            System.out.println(result);
        }
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            String[] line = sc.nextLine().split(" ");

            int n = Integer.valueOf(line[0]);
            int k = Integer.valueOf(line[1]);

            int aCnt = n - k;

            long result = 0;
            if (aCnt <= 0) {
                System.out.println(result);
                return;
            }

            long[] dList = new long[n];

            for(int i=0;i<n;i++){
                dList[i] = sc.nextInt();
            }
            Arrays.sort(dList);

            for (int i = 0; i < aCnt; i++) {
                result += dList[i];
            }

            System.out.println(result);
        }
    }
} Main public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            String[] line = sc.nextLine().split(" ");

            int n = Integer.valueOf(line[0]);
            int k = Integer.valueOf(line[1]);

            int aCnt = n - k;

            long result = 0;
            if (aCnt <= 0) {
                System.out.println(result);
                return;
            }

            long[] dList = new long[n];

            for(int i=0;i<n;i++){
                dList[i] = sc.nextInt();
            }
            Arrays.sort(dList);

            for (int i = 0; i < aCnt; i++) {
                result += dList[i];
            }

            System.out.println(result);
        }
    } main {
        try (Scanner sc = new Scanner(System.in)) {
            String[] line = sc.nextLine().split(" ");

            int n = Integer.valueOf(line[0]);
            int k = Integer.valueOf(line[1]);

            int aCnt = n - k;

            long result = 0;
            if (aCnt <= 0) {
                System.out.println(result);
                return;
            }

            long[] dList = new long[n];

            for(int i=0;i<n;i++){
                dList[i] = sc.nextInt();
            }
            Arrays.sort(dList);

            for (int i = 0; i < aCnt; i++) {
                result += dList[i];
            }

            System.out.println(result);
        }
    } try (Scanner sc = new Scanner(System.in)) {
            String[] line = sc.nextLine().split(" ");

            int n = Integer.valueOf(line[0]);
            int k = Integer.valueOf(line[1]);

            int aCnt = n - k;

            long result = 0;
            if (aCnt <= 0) {
                System.out.println(result);
                return;
            }

            long[] dList = new long[n];

            for(int i=0;i<n;i++){
                dList[i] = sc.nextInt();
            }
            Arrays.sort(dList);

            for (int i = 0; i < aCnt; i++) {
                result += dList[i];
            }

            System.out.println(result);
        } {
            String[] line = sc.nextLine().split(" ");

            int n = Integer.valueOf(line[0]);
            int k = Integer.valueOf(line[1]);

            int aCnt = n - k;

            long result = 0;
            if (aCnt <= 0) {
                System.out.println(result);
                return;
            }

            long[] dList = new long[n];

            for(int i=0;i<n;i++){
                dList[i] = sc.nextInt();
            }
            Arrays.sort(dList);

            for (int i = 0; i < aCnt; i++) {
                result += dList[i];
            }

            System.out.println(result);
        } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) String[] line = sc.nextLine().split(" "); line sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " int n = Integer.valueOf(line[0]); n Integer.valueOf(line[0]) Integer.valueOf Integer line[0] line 0 int k = Integer.valueOf(line[1]); k Integer.valueOf(line[1]) Integer.valueOf Integer line[1] line 1 int aCnt = n - k; aCnt n - k n k long result = 0; result 0 if (aCnt <= 0) {
                System.out.println(result);
                return;
            } aCnt <= 0 aCnt 0 {
                System.out.println(result);
                return;
            } System.out.println(result) System.out.println System.out System System.out result return; long[] dList = new long[n]; dList new long[n] n for(int i=0;i<n;i++){
                dList[i] = sc.nextInt();
            } int i=0; int i=0; i 0 i<n i n i++ i++ i {
                dList[i] = sc.nextInt();
            } {
                dList[i] = sc.nextInt();
            } dList[i] = sc.nextInt() dList[i] dList i sc.nextInt() sc.nextInt sc Arrays.sort(dList) Arrays.sort Arrays dList for (int i = 0; i < aCnt; i++) {
                result += dList[i];
            } int i = 0; int i = 0; i 0 i < aCnt i aCnt i++ i++ i {
                result += dList[i];
            } {
                result += dList[i];
            } result += dList[i] result dList[i] dList i System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            String[] line = sc.nextLine().split(" ");

            int n = Integer.valueOf(line[0]);
            int k = Integer.valueOf(line[1]);

            int aCnt = n - k;

            long result = 0;
            if (aCnt <= 0) {
                System.out.println(result);
                return;
            }

            long[] dList = new long[n];

            for(int i=0;i<n;i++){
                dList[i] = sc.nextInt();
            }
            Arrays.sort(dList);

            for (int i = 0; i < aCnt; i++) {
                result += dList[i];
            }

            System.out.println(result);
        }
    }
} public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            String[] line = sc.nextLine().split(" ");

            int n = Integer.valueOf(line[0]);
            int k = Integer.valueOf(line[1]);

            int aCnt = n - k;

            long result = 0;
            if (aCnt <= 0) {
                System.out.println(result);
                return;
            }

            long[] dList = new long[n];

            for(int i=0;i<n;i++){
                dList[i] = sc.nextInt();
            }
            Arrays.sort(dList);

            for (int i = 0; i < aCnt; i++) {
                result += dList[i];
            }

            System.out.println(result);
        }
    }
} Main
import java.util.Arrays;
import java.util.Scanner;

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

            int n = Integer.valueOf(line[0]);
            int k = Integer.valueOf(line[1]);

            int aCnt = n - k;

            long result = 0;
            if (aCnt <= 0) {
                System.out.println(result);
                return;
            }

            long[] dList = new long[n];

            for(int i=0;i<n;i++){
                dList[i] = sc.nextInt();
            }
            Arrays.sort(dList);

            for (int i = 0; i < aCnt; i++) {
                result += dList[i];
            }

            System.out.println(result);
        }
    }
}