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

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

        int N = scanner.nextInt();
        int K = scanner.nextInt();

        long[] H = new long[N];

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

        Arrays.sort(H);

        long total = 0L;
        for (int i = 0 ; i < N - K ; i++) {
            total += H[i];
        }

        System.out.println(total);
    }
} 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 N = scanner.nextInt();
        int K = scanner.nextInt();

        long[] H = new long[N];

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

        Arrays.sort(H);

        long total = 0L;
        for (int i = 0 ; i < N - K ; i++) {
            total += H[i];
        }

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

        int N = scanner.nextInt();
        int K = scanner.nextInt();

        long[] H = new long[N];

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

        Arrays.sort(H);

        long total = 0L;
        for (int i = 0 ; i < N - K ; i++) {
            total += H[i];
        }

        System.out.println(total);
    } main {
        Scanner scanner = new Scanner(System.in);

        int N = scanner.nextInt();
        int K = scanner.nextInt();

        long[] H = new long[N];

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

        Arrays.sort(H);

        long total = 0L;
        for (int i = 0 ; i < N - K ; i++) {
            total += H[i];
        }

        System.out.println(total);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner int K = scanner.nextInt(); K scanner.nextInt() scanner.nextInt scanner long[] H = new long[N]; H new long[N] N for (int i = 0 ; i < N ; i++) {
            H[i] = scanner.nextLong();
        } int i = 0 ; int i = 0 ; i 0 i < N i N i++ i++ i {
            H[i] = scanner.nextLong();
        } {
            H[i] = scanner.nextLong();
        } H[i] = scanner.nextLong() H[i] H i scanner.nextLong() scanner.nextLong scanner Arrays.sort(H) Arrays.sort Arrays H long total = 0L; total 0L for (int i = 0 ; i < N - K ; i++) {
            total += H[i];
        } int i = 0 ; int i = 0 ; i 0 i < N - K i N - K N K i++ i++ i {
            total += H[i];
        } {
            total += H[i];
        } total += H[i] total H[i] H i System.out.println(total) System.out.println System.out System System.out total String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int N = scanner.nextInt();
        int K = scanner.nextInt();

        long[] H = new long[N];

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

        Arrays.sort(H);

        long total = 0L;
        for (int i = 0 ; i < N - K ; i++) {
            total += H[i];
        }

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

        int N = scanner.nextInt();
        int K = scanner.nextInt();

        long[] H = new long[N];

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

        Arrays.sort(H);

        long total = 0L;
        for (int i = 0 ; i < N - K ; i++) {
            total += H[i];
        }

        System.out.println(total);
    }
} 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 N = scanner.nextInt();
        int K = scanner.nextInt();

        long[] H = new long[N];

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

        Arrays.sort(H);

        long total = 0L;
        for (int i = 0 ; i < N - K ; i++) {
            total += H[i];
        }

        System.out.println(total);
    }
}
