import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
import java.util.Collections;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int N = Integer.parseInt(in.next());
            int K = Integer.parseInt(in.next());
            Integer[] H = new Integer[N];
            long ans = 0;
            for (int i = 0; i < N; i++) {
                H[i] = Integer.valueOf(in.next());
                ans += H[i];
            }
            Arrays.sort(H, Collections.reverseOrder());
            if (K > N) K = N;
            for (int i = 0; i < K; i++) {
                ans -= H[i];
            }

            // 出力
            out.println(ans);

        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util import java.util.Collections; Collections java.util public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int N = Integer.parseInt(in.next());
            int K = Integer.parseInt(in.next());
            Integer[] H = new Integer[N];
            long ans = 0;
            for (int i = 0; i < N; i++) {
                H[i] = Integer.valueOf(in.next());
                ans += H[i];
            }
            Arrays.sort(H, Collections.reverseOrder());
            if (K > N) K = N;
            for (int i = 0; i < K; i++) {
                ans -= H[i];
            }

            // 出力
            out.println(ans);

        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out Scanner in = new Scanner(inputStream); in new Scanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) C solver = new C(); solver new C() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int N = Integer.parseInt(in.next());
            int K = Integer.parseInt(in.next());
            Integer[] H = new Integer[N];
            long ans = 0;
            for (int i = 0; i < N; i++) {
                H[i] = Integer.valueOf(in.next());
                ans += H[i];
            }
            Arrays.sort(H, Collections.reverseOrder());
            if (K > N) K = N;
            for (int i = 0; i < K; i++) {
                ans -= H[i];
            }

            // 出力
            out.println(ans);

        }

    } C public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int N = Integer.parseInt(in.next());
            int K = Integer.parseInt(in.next());
            Integer[] H = new Integer[N];
            long ans = 0;
            for (int i = 0; i < N; i++) {
                H[i] = Integer.valueOf(in.next());
                ans += H[i];
            }
            Arrays.sort(H, Collections.reverseOrder());
            if (K > N) K = N;
            for (int i = 0; i < K; i++) {
                ans -= H[i];
            }

            // 出力
            out.println(ans);

        } solve {
            // 入力
            int N = Integer.parseInt(in.next());
            int K = Integer.parseInt(in.next());
            Integer[] H = new Integer[N];
            long ans = 0;
            for (int i = 0; i < N; i++) {
                H[i] = Integer.valueOf(in.next());
                ans += H[i];
            }
            Arrays.sort(H, Collections.reverseOrder());
            if (K > N) K = N;
            for (int i = 0; i < K; i++) {
                ans -= H[i];
            }

            // 出力
            out.println(ans);

        } int N = Integer.parseInt(in.next()); N Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in int K = Integer.parseInt(in.next()); K Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in Integer[] H = new Integer[N]; H new Integer[N] N long ans = 0; ans 0 for (int i = 0; i < N; i++) {
                H[i] = Integer.valueOf(in.next());
                ans += H[i];
            } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                H[i] = Integer.valueOf(in.next());
                ans += H[i];
            } {
                H[i] = Integer.valueOf(in.next());
                ans += H[i];
            } H[i] = Integer.valueOf(in.next()) H[i] H i Integer.valueOf(in.next()) Integer.valueOf Integer in.next() in.next in ans += H[i] ans H[i] H i Arrays.sort(H, Collections.reverseOrder()) Arrays.sort Arrays H Collections.reverseOrder() Collections.reverseOrder Collections if (K > N) K = N; K > N K N K = N K N for (int i = 0; i < K; i++) {
                ans -= H[i];
            } int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
                ans -= H[i];
            } {
                ans -= H[i];
            } ans -= H[i] ans H[i] H i out.println(ans) out.println out ans int testNumber testNumber Scanner in in PrintWriter out out public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int N = Integer.parseInt(in.next());
            int K = Integer.parseInt(in.next());
            Integer[] H = new Integer[N];
            long ans = 0;
            for (int i = 0; i < N; i++) {
                H[i] = Integer.valueOf(in.next());
                ans += H[i];
            }
            Arrays.sort(H, Collections.reverseOrder());
            if (K > N) K = N;
            for (int i = 0; i < K; i++) {
                ans -= H[i];
            }

            // 出力
            out.println(ans);

        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int N = Integer.parseInt(in.next());
            int K = Integer.parseInt(in.next());
            Integer[] H = new Integer[N];
            long ans = 0;
            for (int i = 0; i < N; i++) {
                H[i] = Integer.valueOf(in.next());
                ans += H[i];
            }
            Arrays.sort(H, Collections.reverseOrder());
            if (K > N) K = N;
            for (int i = 0; i < K; i++) {
                ans -= H[i];
            }

            // 出力
            out.println(ans);

        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
import java.util.Collections;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int N = Integer.parseInt(in.next());
            int K = Integer.parseInt(in.next());
            Integer[] H = new Integer[N];
            long ans = 0;
            for (int i = 0; i < N; i++) {
                H[i] = Integer.valueOf(in.next());
                ans += H[i];
            }
            Arrays.sort(H, Collections.reverseOrder());
            if (K > N) K = N;
            for (int i = 0; i < K; i++) {
                ans -= H[i];
            }

            // 出力
            out.println(ans);

        }

    }
}

