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


// 137_b
public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int k = sc.nextInt();

        long[] h = new long[n];
        // ArrayList<Integer> al = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            // al.add(sc.nextInt());
            h[i] = sc.nextInt();
        }

        Arrays.sort(h);

        for (int i = 0; i < k; i++) {
            if (!(n - 1 - i < 0)) {
                h[n - 1 - i] = 0;
            }
        }
        long count = 0l;
        for (int i = 0; i < n; i++) {
            count += h[i];
        }

        out(count);

    }

    /*
     * 以下メソッド集
     */

    static long gcd(long a, long b) {

        return (b == 0) ? a : gcd(b, a % b);
    }

    static int gcd(int a, int b) {

        return (b == 0) ? a : gcd(b, a % b);
    }

    static void out(String info) {

        System.out.println(info);
    }

    static void out(int info) {

        System.out.println(info);
    }

    static void out(double info) {

        System.out.println(info);
    }

    static void out(long info) {

        System.out.println(info);
    }

} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner 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[] h = new long[n];
        // ArrayList<Integer> al = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            // al.add(sc.nextInt());
            h[i] = sc.nextInt();
        }

        Arrays.sort(h);

        for (int i = 0; i < k; i++) {
            if (!(n - 1 - i < 0)) {
                h[n - 1 - i] = 0;
            }
        }
        long count = 0l;
        for (int i = 0; i < n; i++) {
            count += h[i];
        }

        out(count);

    }

    /*
     * 以下メソッド集
     */

    static long gcd(long a, long b) {

        return (b == 0) ? a : gcd(b, a % b);
    }

    static int gcd(int a, int b) {

        return (b == 0) ? a : gcd(b, a % b);
    }

    static void out(String info) {

        System.out.println(info);
    }

    static void out(int info) {

        System.out.println(info);
    }

    static void out(double info) {

        System.out.println(info);
    }

    static void out(long info) {

        System.out.println(info);
    }

} Main public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int k = sc.nextInt();

        long[] h = new long[n];
        // ArrayList<Integer> al = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            // al.add(sc.nextInt());
            h[i] = sc.nextInt();
        }

        Arrays.sort(h);

        for (int i = 0; i < k; i++) {
            if (!(n - 1 - i < 0)) {
                h[n - 1 - i] = 0;
            }
        }
        long count = 0l;
        for (int i = 0; i < n; i++) {
            count += h[i];
        }

        out(count);

    } main {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int k = sc.nextInt();

        long[] h = new long[n];
        // ArrayList<Integer> al = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            // al.add(sc.nextInt());
            h[i] = sc.nextInt();
        }

        Arrays.sort(h);

        for (int i = 0; i < k; i++) {
            if (!(n - 1 - i < 0)) {
                h[n - 1 - i] = 0;
            }
        }
        long count = 0l;
        for (int i = 0; i < n; i++) {
            count += h[i];
        }

        out(count);

    } 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[] h = new long[n]; h new long[n] n for (int i = 0; i < n; i++) {
            // al.add(sc.nextInt());
            h[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            // al.add(sc.nextInt());
            h[i] = sc.nextInt();
        } {
            // al.add(sc.nextInt());
            h[i] = sc.nextInt();
        } h[i] = sc.nextInt() h[i] h i sc.nextInt() sc.nextInt sc Arrays.sort(h) Arrays.sort Arrays h for (int i = 0; i < k; i++) {
            if (!(n - 1 - i < 0)) {
                h[n - 1 - i] = 0;
            }
        } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
            if (!(n - 1 - i < 0)) {
                h[n - 1 - i] = 0;
            }
        } {
            if (!(n - 1 - i < 0)) {
                h[n - 1 - i] = 0;
            }
        } if (!(n - 1 - i < 0)) {
                h[n - 1 - i] = 0;
            } !(n - 1 - i < 0) (n - 1 - i < 0) n - 1 - i n - 1 - i n 1 i 0 {
                h[n - 1 - i] = 0;
            } h[n - 1 - i] = 0 h[n - 1 - i] h n - 1 - i n - 1 - i n 1 i 0 long count = 0l; count 0l for (int i = 0; i < n; i++) {
            count += h[i];
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            count += h[i];
        } {
            count += h[i];
        } count += h[i] count h[i] h i out(count) out count String[] args args static long gcd(long a, long b) {

        return (b == 0) ? a : gcd(b, a % b);
    } gcd {

        return (b == 0) ? a : gcd(b, a % b);
    } return (b == 0) ? a : gcd(b, a % b); (b == 0) ? a : gcd(b, a % b) (b == 0) b 0 a gcd(b, a % b) gcd b a % b a b long a a long b b static int gcd(int a, int b) {

        return (b == 0) ? a : gcd(b, a % b);
    } gcd {

        return (b == 0) ? a : gcd(b, a % b);
    } return (b == 0) ? a : gcd(b, a % b); (b == 0) ? a : gcd(b, a % b) (b == 0) b 0 a gcd(b, a % b) gcd b a % b a b int a a int b b static void out(String info) {

        System.out.println(info);
    } out {

        System.out.println(info);
    } System.out.println(info) System.out.println System.out System System.out info String info info static void out(int info) {

        System.out.println(info);
    } out {

        System.out.println(info);
    } System.out.println(info) System.out.println System.out System System.out info int info info static void out(double info) {

        System.out.println(info);
    } out {

        System.out.println(info);
    } System.out.println(info) System.out.println System.out System System.out info double info info static void out(long info) {

        System.out.println(info);
    } out {

        System.out.println(info);
    } System.out.println(info) System.out.println System.out System System.out info long info info public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int k = sc.nextInt();

        long[] h = new long[n];
        // ArrayList<Integer> al = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            // al.add(sc.nextInt());
            h[i] = sc.nextInt();
        }

        Arrays.sort(h);

        for (int i = 0; i < k; i++) {
            if (!(n - 1 - i < 0)) {
                h[n - 1 - i] = 0;
            }
        }
        long count = 0l;
        for (int i = 0; i < n; i++) {
            count += h[i];
        }

        out(count);

    }

    /*
     * 以下メソッド集
     */

    static long gcd(long a, long b) {

        return (b == 0) ? a : gcd(b, a % b);
    }

    static int gcd(int a, int b) {

        return (b == 0) ? a : gcd(b, a % b);
    }

    static void out(String info) {

        System.out.println(info);
    }

    static void out(int info) {

        System.out.println(info);
    }

    static void out(double info) {

        System.out.println(info);
    }

    static void out(long info) {

        System.out.println(info);
    }

} public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int k = sc.nextInt();

        long[] h = new long[n];
        // ArrayList<Integer> al = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            // al.add(sc.nextInt());
            h[i] = sc.nextInt();
        }

        Arrays.sort(h);

        for (int i = 0; i < k; i++) {
            if (!(n - 1 - i < 0)) {
                h[n - 1 - i] = 0;
            }
        }
        long count = 0l;
        for (int i = 0; i < n; i++) {
            count += h[i];
        }

        out(count);

    }

    /*
     * 以下メソッド集
     */

    static long gcd(long a, long b) {

        return (b == 0) ? a : gcd(b, a % b);
    }

    static int gcd(int a, int b) {

        return (b == 0) ? a : gcd(b, a % b);
    }

    static void out(String info) {

        System.out.println(info);
    }

    static void out(int info) {

        System.out.println(info);
    }

    static void out(double info) {

        System.out.println(info);
    }

    static void out(long info) {

        System.out.println(info);
    }

} Main
import java.util.Arrays;
import java.util.Scanner;


// 137_b
public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int k = sc.nextInt();

        long[] h = new long[n];
        // ArrayList<Integer> al = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            // al.add(sc.nextInt());
            h[i] = sc.nextInt();
        }

        Arrays.sort(h);

        for (int i = 0; i < k; i++) {
            if (!(n - 1 - i < 0)) {
                h[n - 1 - i] = 0;
            }
        }
        long count = 0l;
        for (int i = 0; i < n; i++) {
            count += h[i];
        }

        out(count);

    }

    /*
     * 以下メソッド集
     */

    static long gcd(long a, long b) {

        return (b == 0) ? a : gcd(b, a % b);
    }

    static int gcd(int a, int b) {

        return (b == 0) ? a : gcd(b, a % b);
    }

    static void out(String info) {

        System.out.println(info);
    }

    static void out(int info) {

        System.out.println(info);
    }

    static void out(double info) {

        System.out.println(info);
    }

    static void out(long info) {

        System.out.println(info);
    }

}
