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

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

    public Main() {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int K = Integer.parseInt(sc.next());
        if (K >= N) {
            System.out.println(0);
            return;
        }
        Integer[] H = new Integer[N];
        for (int i = 0; i < N; i++) {
            Integer hi = Integer.parseInt(sc.next());
            H[i] = hi;
        }
        Arrays.sort(H, Collections.reverseOrder());
        long sum = 0;
        for (int i = K; i < N; i++) {
            Integer hi = H[i];
            sum += hi;
        }
        System.out.println(sum);
    }
} import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        new Main();
    }

    public Main() {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int K = Integer.parseInt(sc.next());
        if (K >= N) {
            System.out.println(0);
            return;
        }
        Integer[] H = new Integer[N];
        for (int i = 0; i < N; i++) {
            Integer hi = Integer.parseInt(sc.next());
            H[i] = hi;
        }
        Arrays.sort(H, Collections.reverseOrder());
        long sum = 0;
        for (int i = K; i < N; i++) {
            Integer hi = H[i];
            sum += hi;
        }
        System.out.println(sum);
    }
} Main public static void main(String[] args) {
        new Main();
    } main {
        new Main();
    } new Main() String[] args args public Main() {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int K = Integer.parseInt(sc.next());
        if (K >= N) {
            System.out.println(0);
            return;
        }
        Integer[] H = new Integer[N];
        for (int i = 0; i < N; i++) {
            Integer hi = Integer.parseInt(sc.next());
            H[i] = hi;
        }
        Arrays.sort(H, Collections.reverseOrder());
        long sum = 0;
        for (int i = K; i < N; i++) {
            Integer hi = H[i];
            sum += hi;
        }
        System.out.println(sum);
    } Main {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int K = Integer.parseInt(sc.next());
        if (K >= N) {
            System.out.println(0);
            return;
        }
        Integer[] H = new Integer[N];
        for (int i = 0; i < N; i++) {
            Integer hi = Integer.parseInt(sc.next());
            H[i] = hi;
        }
        Arrays.sort(H, Collections.reverseOrder());
        long sum = 0;
        for (int i = K; i < N; i++) {
            Integer hi = H[i];
            sum += hi;
        }
        System.out.println(sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int K = Integer.parseInt(sc.next()); K Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc if (K >= N) {
            System.out.println(0);
            return;
        } K >= N K N {
            System.out.println(0);
            return;
        } System.out.println(0) System.out.println System.out System System.out 0 return; Integer[] H = new Integer[N]; H new Integer[N] N for (int i = 0; i < N; i++) {
            Integer hi = Integer.parseInt(sc.next());
            H[i] = hi;
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            Integer hi = Integer.parseInt(sc.next());
            H[i] = hi;
        } {
            Integer hi = Integer.parseInt(sc.next());
            H[i] = hi;
        } Integer hi = Integer.parseInt(sc.next()); hi Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc H[i] = hi H[i] H i hi Arrays.sort(H, Collections.reverseOrder()) Arrays.sort Arrays H Collections.reverseOrder() Collections.reverseOrder Collections long sum = 0; sum 0 for (int i = K; i < N; i++) {
            Integer hi = H[i];
            sum += hi;
        } int i = K; int i = K; i K i < N i N i++ i++ i {
            Integer hi = H[i];
            sum += hi;
        } {
            Integer hi = H[i];
            sum += hi;
        } Integer hi = H[i]; hi H[i] H i sum += hi sum hi System.out.println(sum) System.out.println System.out System System.out sum public class Main {
    public static void main(String[] args) {
        new Main();
    }

    public Main() {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int K = Integer.parseInt(sc.next());
        if (K >= N) {
            System.out.println(0);
            return;
        }
        Integer[] H = new Integer[N];
        for (int i = 0; i < N; i++) {
            Integer hi = Integer.parseInt(sc.next());
            H[i] = hi;
        }
        Arrays.sort(H, Collections.reverseOrder());
        long sum = 0;
        for (int i = K; i < N; i++) {
            Integer hi = H[i];
            sum += hi;
        }
        System.out.println(sum);
    }
} public class Main {
    public static void main(String[] args) {
        new Main();
    }

    public Main() {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int K = Integer.parseInt(sc.next());
        if (K >= N) {
            System.out.println(0);
            return;
        }
        Integer[] H = new Integer[N];
        for (int i = 0; i < N; i++) {
            Integer hi = Integer.parseInt(sc.next());
            H[i] = hi;
        }
        Arrays.sort(H, Collections.reverseOrder());
        long sum = 0;
        for (int i = K; i < N; i++) {
            Integer hi = H[i];
            sum += hi;
        }
        System.out.println(sum);
    }
} Main
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

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

    public Main() {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int K = Integer.parseInt(sc.next());
        if (K >= N) {
            System.out.println(0);
            return;
        }
        Integer[] H = new Integer[N];
        for (int i = 0; i < N; i++) {
            Integer hi = Integer.parseInt(sc.next());
            H[i] = hi;
        }
        Arrays.sort(H, Collections.reverseOrder());
        long sum = 0;
        for (int i = K; i < N; i++) {
            Integer hi = H[i];
            sum += hi;
        }
        System.out.println(sum);
    }
}
