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

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int numMon = scanner.nextInt();
        int special = scanner.nextInt();
        int[] hps = new int[numMon];
        for(int i = 0; i < numMon; i++) {
            hps[i] = scanner.nextInt();
        }
        scanner.close();

        Arrays.sort(hps);
        int removeNum = Math.min(special, numMon);
        long remainSum = 0;
        for(int i = 0; i < numMon-removeNum; i++) {
            remainSum += hps[i];
        }

        System.out.println(remainSum);
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int numMon = scanner.nextInt();
        int special = scanner.nextInt();
        int[] hps = new int[numMon];
        for(int i = 0; i < numMon; i++) {
            hps[i] = scanner.nextInt();
        }
        scanner.close();

        Arrays.sort(hps);
        int removeNum = Math.min(special, numMon);
        long remainSum = 0;
        for(int i = 0; i < numMon-removeNum; i++) {
            remainSum += hps[i];
        }

        System.out.println(remainSum);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int numMon = scanner.nextInt();
        int special = scanner.nextInt();
        int[] hps = new int[numMon];
        for(int i = 0; i < numMon; i++) {
            hps[i] = scanner.nextInt();
        }
        scanner.close();

        Arrays.sort(hps);
        int removeNum = Math.min(special, numMon);
        long remainSum = 0;
        for(int i = 0; i < numMon-removeNum; i++) {
            remainSum += hps[i];
        }

        System.out.println(remainSum);
    } main {
        Scanner scanner = new Scanner(System.in);
        int numMon = scanner.nextInt();
        int special = scanner.nextInt();
        int[] hps = new int[numMon];
        for(int i = 0; i < numMon; i++) {
            hps[i] = scanner.nextInt();
        }
        scanner.close();

        Arrays.sort(hps);
        int removeNum = Math.min(special, numMon);
        long remainSum = 0;
        for(int i = 0; i < numMon-removeNum; i++) {
            remainSum += hps[i];
        }

        System.out.println(remainSum);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int numMon = scanner.nextInt(); numMon scanner.nextInt() scanner.nextInt scanner int special = scanner.nextInt(); special scanner.nextInt() scanner.nextInt scanner int[] hps = new int[numMon]; hps new int[numMon] numMon for(int i = 0; i < numMon; i++) {
            hps[i] = scanner.nextInt();
        } int i = 0; int i = 0; i 0 i < numMon i numMon i++ i++ i {
            hps[i] = scanner.nextInt();
        } {
            hps[i] = scanner.nextInt();
        } hps[i] = scanner.nextInt() hps[i] hps i scanner.nextInt() scanner.nextInt scanner scanner.close() scanner.close scanner Arrays.sort(hps) Arrays.sort Arrays hps int removeNum = Math.min(special, numMon); removeNum Math.min(special, numMon) Math.min Math special numMon long remainSum = 0; remainSum 0 for(int i = 0; i < numMon-removeNum; i++) {
            remainSum += hps[i];
        } int i = 0; int i = 0; i 0 i < numMon-removeNum i numMon-removeNum numMon removeNum i++ i++ i {
            remainSum += hps[i];
        } {
            remainSum += hps[i];
        } remainSum += hps[i] remainSum hps[i] hps i System.out.println(remainSum) System.out.println System.out System System.out remainSum String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int numMon = scanner.nextInt();
        int special = scanner.nextInt();
        int[] hps = new int[numMon];
        for(int i = 0; i < numMon; i++) {
            hps[i] = scanner.nextInt();
        }
        scanner.close();

        Arrays.sort(hps);
        int removeNum = Math.min(special, numMon);
        long remainSum = 0;
        for(int i = 0; i < numMon-removeNum; i++) {
            remainSum += hps[i];
        }

        System.out.println(remainSum);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int numMon = scanner.nextInt();
        int special = scanner.nextInt();
        int[] hps = new int[numMon];
        for(int i = 0; i < numMon; i++) {
            hps[i] = scanner.nextInt();
        }
        scanner.close();

        Arrays.sort(hps);
        int removeNum = Math.min(special, numMon);
        long remainSum = 0;
        for(int i = 0; i < numMon-removeNum; i++) {
            remainSum += hps[i];
        }

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

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int numMon = scanner.nextInt();
        int special = scanner.nextInt();
        int[] hps = new int[numMon];
        for(int i = 0; i < numMon; i++) {
            hps[i] = scanner.nextInt();
        }
        scanner.close();

        Arrays.sort(hps);
        int removeNum = Math.min(special, numMon);
        long remainSum = 0;
        for(int i = 0; i < numMon-removeNum; i++) {
            remainSum += hps[i];
        }

        System.out.println(remainSum);
    }
}
