import java.util.*;
import javax.lang.model.util.ElementScanner6;

public class Main {

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

        // 入力
        int n = sc.nextInt();
        int k = sc.nextInt();

        // 処理
        long[] mon = new long[n];
        for (int i = 0; i < n; i++) {
            mon[i] = sc.nextLong();
        }
        Arrays.sort(mon);

        long out = 0;
        if (k >= n) {
            out = 0;
        } else {
            for (int i = (n - 1 - k); i >= 0; i--) {
                out += mon[i];
            }
        }

        // 出力
        System.out.println(out);
    }
} import java.util.*; util.* java import javax.lang.model.util.ElementScanner6; ElementScanner6 javax.lang.model.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[] mon = new long[n];
        for (int i = 0; i < n; i++) {
            mon[i] = sc.nextLong();
        }
        Arrays.sort(mon);

        long out = 0;
        if (k >= n) {
            out = 0;
        } else {
            for (int i = (n - 1 - k); i >= 0; i--) {
                out += mon[i];
            }
        }

        // 出力
        System.out.println(out);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        // 入力
        int n = sc.nextInt();
        int k = sc.nextInt();

        // 処理
        long[] mon = new long[n];
        for (int i = 0; i < n; i++) {
            mon[i] = sc.nextLong();
        }
        Arrays.sort(mon);

        long out = 0;
        if (k >= n) {
            out = 0;
        } else {
            for (int i = (n - 1 - k); i >= 0; i--) {
                out += mon[i];
            }
        }

        // 出力
        System.out.println(out);
    } main {
        Scanner sc = new Scanner(System.in);

        // 入力
        int n = sc.nextInt();
        int k = sc.nextInt();

        // 処理
        long[] mon = new long[n];
        for (int i = 0; i < n; i++) {
            mon[i] = sc.nextLong();
        }
        Arrays.sort(mon);

        long out = 0;
        if (k >= n) {
            out = 0;
        } else {
            for (int i = (n - 1 - k); i >= 0; i--) {
                out += mon[i];
            }
        }

        // 出力
        System.out.println(out);
    } 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[] mon = new long[n]; mon new long[n] n for (int i = 0; i < n; i++) {
            mon[i] = sc.nextLong();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            mon[i] = sc.nextLong();
        } {
            mon[i] = sc.nextLong();
        } mon[i] = sc.nextLong() mon[i] mon i sc.nextLong() sc.nextLong sc Arrays.sort(mon) Arrays.sort Arrays mon long out = 0; out 0 if (k >= n) {
            out = 0;
        } else {
            for (int i = (n - 1 - k); i >= 0; i--) {
                out += mon[i];
            }
        } k >= n k n {
            out = 0;
        } out = 0 out 0 {
            for (int i = (n - 1 - k); i >= 0; i--) {
                out += mon[i];
            }
        } for (int i = (n - 1 - k); i >= 0; i--) {
                out += mon[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 {
                out += mon[i];
            } {
                out += mon[i];
            } out += mon[i] out mon[i] mon i System.out.println(out) System.out.println System.out System System.out out 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[] mon = new long[n];
        for (int i = 0; i < n; i++) {
            mon[i] = sc.nextLong();
        }
        Arrays.sort(mon);

        long out = 0;
        if (k >= n) {
            out = 0;
        } else {
            for (int i = (n - 1 - k); i >= 0; i--) {
                out += mon[i];
            }
        }

        // 出力
        System.out.println(out);
    }
} public class Main {

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

        // 入力
        int n = sc.nextInt();
        int k = sc.nextInt();

        // 処理
        long[] mon = new long[n];
        for (int i = 0; i < n; i++) {
            mon[i] = sc.nextLong();
        }
        Arrays.sort(mon);

        long out = 0;
        if (k >= n) {
            out = 0;
        } else {
            for (int i = (n - 1 - k); i >= 0; i--) {
                out += mon[i];
            }
        }

        // 出力
        System.out.println(out);
    }
} Main
import java.util.*;
import javax.lang.model.util.ElementScanner6;

public class Main {

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

        // 入力
        int n = sc.nextInt();
        int k = sc.nextInt();

        // 処理
        long[] mon = new long[n];
        for (int i = 0; i < n; i++) {
            mon[i] = sc.nextLong();
        }
        Arrays.sort(mon);

        long out = 0;
        if (k >= n) {
            out = 0;
        } else {
            for (int i = (n - 1 - k); i >= 0; i--) {
                out += mon[i];
            }
        }

        // 出力
        System.out.println(out);
    }
}