import 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];
        for (int i = 0; i < N; i++){
            H[i] = sc.nextLong();
        }
        Arrays.sort(H, Collections.reverseOrder());
        for (int i = 0; i < K; i++){
            if (i == N) {
                break;
            }
            H[i] = (long)0;
        }
        long result = 0;
        for (int i = 0; i < N; i++){
            result += H[i];
        }
        System.out.println(result);
    }
} import java.util.*; util.* java 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];
        for (int i = 0; i < N; i++){
            H[i] = sc.nextLong();
        }
        Arrays.sort(H, Collections.reverseOrder());
        for (int i = 0; i < K; i++){
            if (i == N) {
                break;
            }
            H[i] = (long)0;
        }
        long result = 0;
        for (int i = 0; i < N; i++){
            result += H[i];
        }
        System.out.println(result);
    }
} 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];
        for (int i = 0; i < N; i++){
            H[i] = sc.nextLong();
        }
        Arrays.sort(H, Collections.reverseOrder());
        for (int i = 0; i < K; i++){
            if (i == N) {
                break;
            }
            H[i] = (long)0;
        }
        long result = 0;
        for (int i = 0; i < N; i++){
            result += H[i];
        }
        System.out.println(result);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        Long[] H = new Long[N];
        for (int i = 0; i < N; i++){
            H[i] = sc.nextLong();
        }
        Arrays.sort(H, Collections.reverseOrder());
        for (int i = 0; i < K; i++){
            if (i == N) {
                break;
            }
            H[i] = (long)0;
        }
        long result = 0;
        for (int i = 0; i < N; i++){
            result += H[i];
        }
        System.out.println(result);
    } 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++){
            H[i] = sc.nextLong();
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            H[i] = sc.nextLong();
        } {
            H[i] = sc.nextLong();
        } H[i] = sc.nextLong() H[i] H i sc.nextLong() sc.nextLong sc Arrays.sort(H, Collections.reverseOrder()) Arrays.sort Arrays H Collections.reverseOrder() Collections.reverseOrder Collections for (int i = 0; i < K; i++){
            if (i == N) {
                break;
            }
            H[i] = (long)0;
        } int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
            if (i == N) {
                break;
            }
            H[i] = (long)0;
        } {
            if (i == N) {
                break;
            }
            H[i] = (long)0;
        } if (i == N) {
                break;
            } i == N i N {
                break;
            } break; H[i] = (long)0 H[i] H i (long)0 long result = 0; result 0 for (int i = 0; i < N; i++){
            result += H[i];
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            result += H[i];
        } {
            result += H[i];
        } result += H[i] result H[i] H i System.out.println(result) System.out.println System.out System System.out result 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[] H = new Long[N];
        for (int i = 0; i < N; i++){
            H[i] = sc.nextLong();
        }
        Arrays.sort(H, Collections.reverseOrder());
        for (int i = 0; i < K; i++){
            if (i == N) {
                break;
            }
            H[i] = (long)0;
        }
        long result = 0;
        for (int i = 0; i < N; i++){
            result += H[i];
        }
        System.out.println(result);
    }
} 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];
        for (int i = 0; i < N; i++){
            H[i] = sc.nextLong();
        }
        Arrays.sort(H, Collections.reverseOrder());
        for (int i = 0; i < K; i++){
            if (i == N) {
                break;
            }
            H[i] = (long)0;
        }
        long result = 0;
        for (int i = 0; i < N; i++){
            result += H[i];
        }
        System.out.println(result);
    }
} Main
import 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];
        for (int i = 0; i < N; i++){
            H[i] = sc.nextLong();
        }
        Arrays.sort(H, Collections.reverseOrder());
        for (int i = 0; i < K; i++){
            if (i == N) {
                break;
            }
            H[i] = (long)0;
        }
        long result = 0;
        for (int i = 0; i < N; i++){
            result += H[i];
        }
        System.out.println(result);
    }
}
