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

class Main{
    public static void main(String args[]){
        Scanner str = new Scanner(System.in);
        int N = str.nextInt();
        int K = str.nextInt();

        long result = 0;

        long NList[] = new long[N];

        for(int i = 0; i < N; i++){
            NList[i] = str.nextLong();
        }

        Arrays.sort(NList);

        for(int i = N - 1 - K; i >= 0; i--){
            result += NList[i];
        }

        System.out.println(result);

        str.close();
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util class Main{
    public static void main(String args[]){
        Scanner str = new Scanner(System.in);
        int N = str.nextInt();
        int K = str.nextInt();

        long result = 0;

        long NList[] = new long[N];

        for(int i = 0; i < N; i++){
            NList[i] = str.nextLong();
        }

        Arrays.sort(NList);

        for(int i = N - 1 - K; i >= 0; i--){
            result += NList[i];
        }

        System.out.println(result);

        str.close();
    }
} Main public static void main(String args[]){
        Scanner str = new Scanner(System.in);
        int N = str.nextInt();
        int K = str.nextInt();

        long result = 0;

        long NList[] = new long[N];

        for(int i = 0; i < N; i++){
            NList[i] = str.nextLong();
        }

        Arrays.sort(NList);

        for(int i = N - 1 - K; i >= 0; i--){
            result += NList[i];
        }

        System.out.println(result);

        str.close();
    } main {
        Scanner str = new Scanner(System.in);
        int N = str.nextInt();
        int K = str.nextInt();

        long result = 0;

        long NList[] = new long[N];

        for(int i = 0; i < N; i++){
            NList[i] = str.nextLong();
        }

        Arrays.sort(NList);

        for(int i = N - 1 - K; i >= 0; i--){
            result += NList[i];
        }

        System.out.println(result);

        str.close();
    } Scanner str = new Scanner(System.in); str new Scanner(System.in) int N = str.nextInt(); N str.nextInt() str.nextInt str int K = str.nextInt(); K str.nextInt() str.nextInt str long result = 0; result 0 long NList[] = new long[N]; NList new long[N] N for(int i = 0; i < N; i++){
            NList[i] = str.nextLong();
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            NList[i] = str.nextLong();
        } {
            NList[i] = str.nextLong();
        } NList[i] = str.nextLong() NList[i] NList i str.nextLong() str.nextLong str Arrays.sort(NList) Arrays.sort Arrays NList for(int i = N - 1 - K; i >= 0; i--){
            result += NList[i];
        } int i = N - 1 - K; int i = N - 1 - K; i N - 1 - K N - 1 - K N 1 K i >= 0 i 0 i-- i-- i {
            result += NList[i];
        } {
            result += NList[i];
        } result += NList[i] result NList[i] NList i System.out.println(result) System.out.println System.out System System.out result str.close() str.close str String args[] args
import java.util.Arrays;
import java.util.Scanner;

class Main{
    public static void main(String args[]){
        Scanner str = new Scanner(System.in);
        int N = str.nextInt();
        int K = str.nextInt();

        long result = 0;

        long NList[] = new long[N];

        for(int i = 0; i < N; i++){
            NList[i] = str.nextLong();
        }

        Arrays.sort(NList);

        for(int i = N - 1 - K; i >= 0; i--){
            result += NList[i];
        }

        System.out.println(result);

        str.close();
    }
}