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

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        Integer[] arr = new Integer[N];
        for( int i = 0; i < N; i++ ) arr[i] = sc.nextInt();
        Arrays.sort(arr, Collections.reverseOrder());
        long res = 0;
        for(int i = K; i < N; i++) {
            res += arr[i];
        }
        System.out.println(res);
    }
} 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) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        Integer[] arr = new Integer[N];
        for( int i = 0; i < N; i++ ) arr[i] = sc.nextInt();
        Arrays.sort(arr, Collections.reverseOrder());
        long res = 0;
        for(int i = K; i < N; i++) {
            res += arr[i];
        }
        System.out.println(res);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        Integer[] arr = new Integer[N];
        for( int i = 0; i < N; i++ ) arr[i] = sc.nextInt();
        Arrays.sort(arr, Collections.reverseOrder());
        long res = 0;
        for(int i = K; i < N; i++) {
            res += arr[i];
        }
        System.out.println(res);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        Integer[] arr = new Integer[N];
        for( int i = 0; i < N; i++ ) arr[i] = sc.nextInt();
        Arrays.sort(arr, Collections.reverseOrder());
        long res = 0;
        for(int i = K; i < N; i++) {
            res += arr[i];
        }
        System.out.println(res);
    } 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 Integer[] arr = new Integer[N]; arr new Integer[N] N for( int i = 0; i < N; i++ ) arr[i] = sc.nextInt(); int i = 0; int i = 0; i 0 i < N i N i++ i++ i arr[i] = sc.nextInt(); arr[i] = sc.nextInt() arr[i] arr i sc.nextInt() sc.nextInt sc Arrays.sort(arr, Collections.reverseOrder()) Arrays.sort Arrays arr Collections.reverseOrder() Collections.reverseOrder Collections long res = 0; res 0 for(int i = K; i < N; i++) {
            res += arr[i];
        } int i = K; int i = K; i K i < N i N i++ i++ i {
            res += arr[i];
        } {
            res += arr[i];
        } res += arr[i] res arr[i] arr i System.out.println(res) System.out.println System.out System System.out res 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();
        Integer[] arr = new Integer[N];
        for( int i = 0; i < N; i++ ) arr[i] = sc.nextInt();
        Arrays.sort(arr, Collections.reverseOrder());
        long res = 0;
        for(int i = K; i < N; i++) {
            res += arr[i];
        }
        System.out.println(res);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        Integer[] arr = new Integer[N];
        for( int i = 0; i < N; i++ ) arr[i] = sc.nextInt();
        Arrays.sort(arr, Collections.reverseOrder());
        long res = 0;
        for(int i = K; i < N; i++) {
            res += arr[i];
        }
        System.out.println(res);
    }
} Main
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        Integer[] arr = new Integer[N];
        for( int i = 0; i < N; i++ ) arr[i] = sc.nextInt();
        Arrays.sort(arr, Collections.reverseOrder());
        long res = 0;
        for(int i = K; i < N; i++) {
            res += arr[i];
        }
        System.out.println(res);
    }
}
