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

class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int n = Integer.parseInt(stdIn.next());
        long k = Long.parseLong(stdIn.next());
        long[] h = new long[n];
        for (int i = 0; i < n; i++) {
            h[i] = Long.parseLong(stdIn.next());
        }

        Arrays.sort(h);

        long ans = 0;
        for (int i = 0; i <= n - k - 1; i++) {
            ans += h[i];
        }
        System.out.println(ans);
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int n = Integer.parseInt(stdIn.next());
        long k = Long.parseLong(stdIn.next());
        long[] h = new long[n];
        for (int i = 0; i < n; i++) {
            h[i] = Long.parseLong(stdIn.next());
        }

        Arrays.sort(h);

        long ans = 0;
        for (int i = 0; i <= n - k - 1; i++) {
            ans += h[i];
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int n = Integer.parseInt(stdIn.next());
        long k = Long.parseLong(stdIn.next());
        long[] h = new long[n];
        for (int i = 0; i < n; i++) {
            h[i] = Long.parseLong(stdIn.next());
        }

        Arrays.sort(h);

        long ans = 0;
        for (int i = 0; i <= n - k - 1; i++) {
            ans += h[i];
        }
        System.out.println(ans);
    } main {
        Scanner stdIn = new Scanner(System.in);
        int n = Integer.parseInt(stdIn.next());
        long k = Long.parseLong(stdIn.next());
        long[] h = new long[n];
        for (int i = 0; i < n; i++) {
            h[i] = Long.parseLong(stdIn.next());
        }

        Arrays.sort(h);

        long ans = 0;
        for (int i = 0; i <= n - k - 1; i++) {
            ans += h[i];
        }
        System.out.println(ans);
    } Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int n = Integer.parseInt(stdIn.next()); n Integer.parseInt(stdIn.next()) Integer.parseInt Integer stdIn.next() stdIn.next stdIn long k = Long.parseLong(stdIn.next()); k Long.parseLong(stdIn.next()) Long.parseLong Long stdIn.next() stdIn.next stdIn long[] h = new long[n]; h new long[n] n for (int i = 0; i < n; i++) {
            h[i] = Long.parseLong(stdIn.next());
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            h[i] = Long.parseLong(stdIn.next());
        } {
            h[i] = Long.parseLong(stdIn.next());
        } h[i] = Long.parseLong(stdIn.next()) h[i] h i Long.parseLong(stdIn.next()) Long.parseLong Long stdIn.next() stdIn.next stdIn Arrays.sort(h) Arrays.sort Arrays h long ans = 0; ans 0 for (int i = 0; i <= n - k - 1; i++) {
            ans += h[i];
        } int i = 0; int i = 0; i 0 i <= n - k - 1 i n - k - 1 n - k - 1 n k 1 i++ i++ i {
            ans += h[i];
        } {
            ans += h[i];
        } ans += h[i] ans h[i] h i System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.Arrays;
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int n = Integer.parseInt(stdIn.next());
        long k = Long.parseLong(stdIn.next());
        long[] h = new long[n];
        for (int i = 0; i < n; i++) {
            h[i] = Long.parseLong(stdIn.next());
        }

        Arrays.sort(h);

        long ans = 0;
        for (int i = 0; i <= n - k - 1; i++) {
            ans += h[i];
        }
        System.out.println(ans);
    }
}