import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        long Hz[] = new long[N];
        long sortedHz[] = new long[N];
        for (int i = 0; i < N; i++){
            Hz[i] = sc.nextInt();
        }
        Arrays.sort(Hz);
        for (int i = 0; i < N; i++) {
            sortedHz[N - i - 1] = Hz[i];
//            System.out.println(sortedHz[N - i - 1]);
        }

        long sum = 0;
        for (int i = 0; i < N; i++) {
            if (i <= K - 1){
                continue;
            }

            sum += sortedHz[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 N = sc.nextInt();
        int K = sc.nextInt();
        long Hz[] = new long[N];
        long sortedHz[] = new long[N];
        for (int i = 0; i < N; i++){
            Hz[i] = sc.nextInt();
        }
        Arrays.sort(Hz);
        for (int i = 0; i < N; i++) {
            sortedHz[N - i - 1] = Hz[i];
//            System.out.println(sortedHz[N - i - 1]);
        }

        long sum = 0;
        for (int i = 0; i < N; i++) {
            if (i <= K - 1){
                continue;
            }

            sum += sortedHz[i];
        }
        System.out.println(sum);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        long Hz[] = new long[N];
        long sortedHz[] = new long[N];
        for (int i = 0; i < N; i++){
            Hz[i] = sc.nextInt();
        }
        Arrays.sort(Hz);
        for (int i = 0; i < N; i++) {
            sortedHz[N - i - 1] = Hz[i];
//            System.out.println(sortedHz[N - i - 1]);
        }

        long sum = 0;
        for (int i = 0; i < N; i++) {
            if (i <= K - 1){
                continue;
            }

            sum += sortedHz[i];
        }
        System.out.println(sum);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        long Hz[] = new long[N];
        long sortedHz[] = new long[N];
        for (int i = 0; i < N; i++){
            Hz[i] = sc.nextInt();
        }
        Arrays.sort(Hz);
        for (int i = 0; i < N; i++) {
            sortedHz[N - i - 1] = Hz[i];
//            System.out.println(sortedHz[N - i - 1]);
        }

        long sum = 0;
        for (int i = 0; i < N; i++) {
            if (i <= K - 1){
                continue;
            }

            sum += sortedHz[i];
        }
        System.out.println(sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc long Hz[] = new long[N]; Hz new long[N] N long sortedHz[] = new long[N]; sortedHz new long[N] N for (int i = 0; i < N; i++){
            Hz[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            Hz[i] = sc.nextInt();
        } {
            Hz[i] = sc.nextInt();
        } Hz[i] = sc.nextInt() Hz[i] Hz i sc.nextInt() sc.nextInt sc Arrays.sort(Hz) Arrays.sort Arrays Hz for (int i = 0; i < N; i++) {
            sortedHz[N - i - 1] = Hz[i];
//            System.out.println(sortedHz[N - i - 1]);
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            sortedHz[N - i - 1] = Hz[i];
//            System.out.println(sortedHz[N - i - 1]);
        } {
            sortedHz[N - i - 1] = Hz[i];
//            System.out.println(sortedHz[N - i - 1]);
        } sortedHz[N - i - 1] = Hz[i] sortedHz[N - i - 1] sortedHz N - i - 1 N - i - 1 N i 1 Hz[i] Hz i long sum = 0; sum 0 for (int i = 0; i < N; i++) {
            if (i <= K - 1){
                continue;
            }

            sum += sortedHz[i];
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            if (i <= K - 1){
                continue;
            }

            sum += sortedHz[i];
        } {
            if (i <= K - 1){
                continue;
            }

            sum += sortedHz[i];
        } if (i <= K - 1){
                continue;
            } i <= K - 1 i K - 1 K 1 {
                continue;
            } continue; sum += sortedHz[i] sum sortedHz[i] sortedHz 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 N = sc.nextInt();
        int K = sc.nextInt();
        long Hz[] = new long[N];
        long sortedHz[] = new long[N];
        for (int i = 0; i < N; i++){
            Hz[i] = sc.nextInt();
        }
        Arrays.sort(Hz);
        for (int i = 0; i < N; i++) {
            sortedHz[N - i - 1] = Hz[i];
//            System.out.println(sortedHz[N - i - 1]);
        }

        long sum = 0;
        for (int i = 0; i < N; i++) {
            if (i <= K - 1){
                continue;
            }

            sum += sortedHz[i];
        }
        System.out.println(sum);
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        long Hz[] = new long[N];
        long sortedHz[] = new long[N];
        for (int i = 0; i < N; i++){
            Hz[i] = sc.nextInt();
        }
        Arrays.sort(Hz);
        for (int i = 0; i < N; i++) {
            sortedHz[N - i - 1] = Hz[i];
//            System.out.println(sortedHz[N - i - 1]);
        }

        long sum = 0;
        for (int i = 0; i < N; i++) {
            if (i <= K - 1){
                continue;
            }

            sum += sortedHz[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 N = sc.nextInt();
        int K = sc.nextInt();
        long Hz[] = new long[N];
        long sortedHz[] = new long[N];
        for (int i = 0; i < N; i++){
            Hz[i] = sc.nextInt();
        }
        Arrays.sort(Hz);
        for (int i = 0; i < N; i++) {
            sortedHz[N - i - 1] = Hz[i];
//            System.out.println(sortedHz[N - i - 1]);
        }

        long sum = 0;
        for (int i = 0; i < N; i++) {
            if (i <= K - 1){
                continue;
            }

            sum += sortedHz[i];
        }
        System.out.println(sum);
    }
}

