import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();
        int K = stdIn.nextInt();
        long[] H = new long[N];
        for (int i = 0; i < N; i++) {
            H[i] = stdIn.nextLong();
        }
        stdIn.close();
        Arrays.sort(H);

        Long sum = (long)0;
        if (N < K) {
            System.out.println(0);
        } else if(K == 0) {
            for (int i = 0; i < N; i++) {
                sum += H[i];
            }
            System.out.println(sum);
        } else {
            for (int i = 0; i < K; i++) {
                H[N-1-i] = 0;
            }
            for (int i = 0; i < N; i++) {
                sum += H[i];
            }
            System.out.println(sum);
        }
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();
        int K = stdIn.nextInt();
        long[] H = new long[N];
        for (int i = 0; i < N; i++) {
            H[i] = stdIn.nextLong();
        }
        stdIn.close();
        Arrays.sort(H);

        Long sum = (long)0;
        if (N < K) {
            System.out.println(0);
        } else if(K == 0) {
            for (int i = 0; i < N; i++) {
                sum += H[i];
            }
            System.out.println(sum);
        } else {
            for (int i = 0; i < K; i++) {
                H[N-1-i] = 0;
            }
            for (int i = 0; i < N; i++) {
                sum += H[i];
            }
            System.out.println(sum);
        }
    }
} Main public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();
        int K = stdIn.nextInt();
        long[] H = new long[N];
        for (int i = 0; i < N; i++) {
            H[i] = stdIn.nextLong();
        }
        stdIn.close();
        Arrays.sort(H);

        Long sum = (long)0;
        if (N < K) {
            System.out.println(0);
        } else if(K == 0) {
            for (int i = 0; i < N; i++) {
                sum += H[i];
            }
            System.out.println(sum);
        } else {
            for (int i = 0; i < K; i++) {
                H[N-1-i] = 0;
            }
            for (int i = 0; i < N; i++) {
                sum += H[i];
            }
            System.out.println(sum);
        }
    } main {
        Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();
        int K = stdIn.nextInt();
        long[] H = new long[N];
        for (int i = 0; i < N; i++) {
            H[i] = stdIn.nextLong();
        }
        stdIn.close();
        Arrays.sort(H);

        Long sum = (long)0;
        if (N < K) {
            System.out.println(0);
        } else if(K == 0) {
            for (int i = 0; i < N; i++) {
                sum += H[i];
            }
            System.out.println(sum);
        } else {
            for (int i = 0; i < K; i++) {
                H[N-1-i] = 0;
            }
            for (int i = 0; i < N; i++) {
                sum += H[i];
            }
            System.out.println(sum);
        }
    } Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int N = stdIn.nextInt(); N stdIn.nextInt() stdIn.nextInt stdIn int K = stdIn.nextInt(); K stdIn.nextInt() stdIn.nextInt stdIn long[] H = new long[N]; H new long[N] N for (int i = 0; i < N; i++) {
            H[i] = stdIn.nextLong();
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            H[i] = stdIn.nextLong();
        } {
            H[i] = stdIn.nextLong();
        } H[i] = stdIn.nextLong() H[i] H i stdIn.nextLong() stdIn.nextLong stdIn stdIn.close() stdIn.close stdIn Arrays.sort(H) Arrays.sort Arrays H Long sum = (long)0; sum (long)0 if (N < K) {
            System.out.println(0);
        } else if(K == 0) {
            for (int i = 0; i < N; i++) {
                sum += H[i];
            }
            System.out.println(sum);
        } else {
            for (int i = 0; i < K; i++) {
                H[N-1-i] = 0;
            }
            for (int i = 0; i < N; i++) {
                sum += H[i];
            }
            System.out.println(sum);
        } N < K N K {
            System.out.println(0);
        } System.out.println(0) System.out.println System.out System System.out 0 if(K == 0) {
            for (int i = 0; i < N; i++) {
                sum += H[i];
            }
            System.out.println(sum);
        } else {
            for (int i = 0; i < K; i++) {
                H[N-1-i] = 0;
            }
            for (int i = 0; i < N; i++) {
                sum += H[i];
            }
            System.out.println(sum);
        } K == 0 K 0 {
            for (int i = 0; i < N; i++) {
                sum += H[i];
            }
            System.out.println(sum);
        } for (int i = 0; i < N; i++) {
                sum += H[i];
            } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                sum += H[i];
            } {
                sum += H[i];
            } sum += H[i] sum H[i] H i System.out.println(sum) System.out.println System.out System System.out sum {
            for (int i = 0; i < K; i++) {
                H[N-1-i] = 0;
            }
            for (int i = 0; i < N; i++) {
                sum += H[i];
            }
            System.out.println(sum);
        } for (int i = 0; i < K; i++) {
                H[N-1-i] = 0;
            } int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
                H[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 for (int i = 0; i < N; i++) {
                sum += H[i];
            } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                sum += H[i];
            } {
                sum += H[i];
            } sum += H[i] sum H[i] H i System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {

    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();
        int K = stdIn.nextInt();
        long[] H = new long[N];
        for (int i = 0; i < N; i++) {
            H[i] = stdIn.nextLong();
        }
        stdIn.close();
        Arrays.sort(H);

        Long sum = (long)0;
        if (N < K) {
            System.out.println(0);
        } else if(K == 0) {
            for (int i = 0; i < N; i++) {
                sum += H[i];
            }
            System.out.println(sum);
        } else {
            for (int i = 0; i < K; i++) {
                H[N-1-i] = 0;
            }
            for (int i = 0; i < N; i++) {
                sum += H[i];
            }
            System.out.println(sum);
        }
    }
} public class Main {

    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();
        int K = stdIn.nextInt();
        long[] H = new long[N];
        for (int i = 0; i < N; i++) {
            H[i] = stdIn.nextLong();
        }
        stdIn.close();
        Arrays.sort(H);

        Long sum = (long)0;
        if (N < K) {
            System.out.println(0);
        } else if(K == 0) {
            for (int i = 0; i < N; i++) {
                sum += H[i];
            }
            System.out.println(sum);
        } else {
            for (int i = 0; i < K; i++) {
                H[N-1-i] = 0;
            }
            for (int i = 0; i < N; i++) {
                sum += H[i];
            }
            System.out.println(sum);
        }
    }
} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();
        int K = stdIn.nextInt();
        long[] H = new long[N];
        for (int i = 0; i < N; i++) {
            H[i] = stdIn.nextLong();
        }
        stdIn.close();
        Arrays.sort(H);

        Long sum = (long)0;
        if (N < K) {
            System.out.println(0);
        } else if(K == 0) {
            for (int i = 0; i < N; i++) {
                sum += H[i];
            }
            System.out.println(sum);
        } else {
            for (int i = 0; i < K; i++) {
                H[N-1-i] = 0;
            }
            for (int i = 0; i < N; i++) {
                sum += H[i];
            }
            System.out.println(sum);
        }
    }
}