import javax.swing.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Collections;


public class Main {
    /*public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int q = Integer.parseInt(reader.readLine());
        while(q>0){
            q--;
        String[] l = reader.readLine().split(" ");
        int a = Integer.parseInt(l[0]);
        int b = Integer.parseInt(l[1]);
        int c = Integer.parseInt(l[2]);
        int n = Integer.parseInt(l[3]);
        int p=(a+b+c+n)/3;
        if((a+b+c+n)%3==0 && p-a>=0 && p-b>=0 && p-c>=0 ) System.out.println("YES");
        else System.out.println("NO");
    }}*/
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String[] l = reader.readLine().split(" ");
        long n = Long.parseLong(l[0]);
        long k = Long.parseLong(l[1]);
        String[] lo = reader.readLine().split(" ");
        if(k>=n){System.out.println(0);}
        else{

            long sum=0;
            long[] list = new long[lo.length];
            for(int i = 0;i<n;i++){
                list[i] = Long.parseLong(lo[i]);
            }
            Arrays.sort(list);
            for(int i = 0;i<n-k;i++){
                sum += list[i];
            }
            System.out.println(sum);
    }
    }
}
 import javax.swing.*; swing.* javax import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util public class Main {
    /*public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int q = Integer.parseInt(reader.readLine());
        while(q>0){
            q--;
        String[] l = reader.readLine().split(" ");
        int a = Integer.parseInt(l[0]);
        int b = Integer.parseInt(l[1]);
        int c = Integer.parseInt(l[2]);
        int n = Integer.parseInt(l[3]);
        int p=(a+b+c+n)/3;
        if((a+b+c+n)%3==0 && p-a>=0 && p-b>=0 && p-c>=0 ) System.out.println("YES");
        else System.out.println("NO");
    }}*/
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String[] l = reader.readLine().split(" ");
        long n = Long.parseLong(l[0]);
        long k = Long.parseLong(l[1]);
        String[] lo = reader.readLine().split(" ");
        if(k>=n){System.out.println(0);}
        else{

            long sum=0;
            long[] list = new long[lo.length];
            for(int i = 0;i<n;i++){
                list[i] = Long.parseLong(lo[i]);
            }
            Arrays.sort(list);
            for(int i = 0;i<n-k;i++){
                sum += list[i];
            }
            System.out.println(sum);
    }
    }
} Main /*public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int q = Integer.parseInt(reader.readLine());
        while(q>0){
            q--;
        String[] l = reader.readLine().split(" ");
        int a = Integer.parseInt(l[0]);
        int b = Integer.parseInt(l[1]);
        int c = Integer.parseInt(l[2]);
        int n = Integer.parseInt(l[3]);
        int p=(a+b+c+n)/3;
        if((a+b+c+n)%3==0 && p-a>=0 && p-b>=0 && p-c>=0 ) System.out.println("YES");
        else System.out.println("NO");
    }}*/
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String[] l = reader.readLine().split(" ");
        long n = Long.parseLong(l[0]);
        long k = Long.parseLong(l[1]);
        String[] lo = reader.readLine().split(" ");
        if(k>=n){System.out.println(0);}
        else{

            long sum=0;
            long[] list = new long[lo.length];
            for(int i = 0;i<n;i++){
                list[i] = Long.parseLong(lo[i]);
            }
            Arrays.sort(list);
            for(int i = 0;i<n-k;i++){
                sum += list[i];
            }
            System.out.println(sum);
    }
    } main {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String[] l = reader.readLine().split(" ");
        long n = Long.parseLong(l[0]);
        long k = Long.parseLong(l[1]);
        String[] lo = reader.readLine().split(" ");
        if(k>=n){System.out.println(0);}
        else{

            long sum=0;
            long[] list = new long[lo.length];
            for(int i = 0;i<n;i++){
                list[i] = Long.parseLong(lo[i]);
            }
            Arrays.sort(list);
            for(int i = 0;i<n-k;i++){
                sum += list[i];
            }
            System.out.println(sum);
    }
    } BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) String[] l = reader.readLine().split(" "); l reader.readLine().split(" ") reader.readLine().split reader.readLine() reader.readLine reader " " long n = Long.parseLong(l[0]); n Long.parseLong(l[0]) Long.parseLong Long l[0] l 0 long k = Long.parseLong(l[1]); k Long.parseLong(l[1]) Long.parseLong Long l[1] l 1 String[] lo = reader.readLine().split(" "); lo reader.readLine().split(" ") reader.readLine().split reader.readLine() reader.readLine reader " " if(k>=n){System.out.println(0);}
        else{

            long sum=0;
            long[] list = new long[lo.length];
            for(int i = 0;i<n;i++){
                list[i] = Long.parseLong(lo[i]);
            }
            Arrays.sort(list);
            for(int i = 0;i<n-k;i++){
                sum += list[i];
            }
            System.out.println(sum);
    } k>=n k n {System.out.println(0);} System.out.println(0) System.out.println System.out System System.out 0 {

            long sum=0;
            long[] list = new long[lo.length];
            for(int i = 0;i<n;i++){
                list[i] = Long.parseLong(lo[i]);
            }
            Arrays.sort(list);
            for(int i = 0;i<n-k;i++){
                sum += list[i];
            }
            System.out.println(sum);
    } long sum=0; sum 0 long[] list = new long[lo.length]; list new long[lo.length] lo.length lo lo.length for(int i = 0;i<n;i++){
                list[i] = Long.parseLong(lo[i]);
            } int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
                list[i] = Long.parseLong(lo[i]);
            } {
                list[i] = Long.parseLong(lo[i]);
            } list[i] = Long.parseLong(lo[i]) list[i] list i Long.parseLong(lo[i]) Long.parseLong Long lo[i] lo i Arrays.sort(list) Arrays.sort Arrays list for(int i = 0;i<n-k;i++){
                sum += list[i];
            } int i = 0; int i = 0; i 0 i<n-k i n-k n k i++ i++ i {
                sum += list[i];
            } {
                sum += list[i];
            } sum += list[i] sum list[i] list 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) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int q = Integer.parseInt(reader.readLine());
        while(q>0){
            q--;
        String[] l = reader.readLine().split(" ");
        int a = Integer.parseInt(l[0]);
        int b = Integer.parseInt(l[1]);
        int c = Integer.parseInt(l[2]);
        int n = Integer.parseInt(l[3]);
        int p=(a+b+c+n)/3;
        if((a+b+c+n)%3==0 && p-a>=0 && p-b>=0 && p-c>=0 ) System.out.println("YES");
        else System.out.println("NO");
    }}*/
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String[] l = reader.readLine().split(" ");
        long n = Long.parseLong(l[0]);
        long k = Long.parseLong(l[1]);
        String[] lo = reader.readLine().split(" ");
        if(k>=n){System.out.println(0);}
        else{

            long sum=0;
            long[] list = new long[lo.length];
            for(int i = 0;i<n;i++){
                list[i] = Long.parseLong(lo[i]);
            }
            Arrays.sort(list);
            for(int i = 0;i<n-k;i++){
                sum += list[i];
            }
            System.out.println(sum);
    }
    }
} public class Main {
    /*public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int q = Integer.parseInt(reader.readLine());
        while(q>0){
            q--;
        String[] l = reader.readLine().split(" ");
        int a = Integer.parseInt(l[0]);
        int b = Integer.parseInt(l[1]);
        int c = Integer.parseInt(l[2]);
        int n = Integer.parseInt(l[3]);
        int p=(a+b+c+n)/3;
        if((a+b+c+n)%3==0 && p-a>=0 && p-b>=0 && p-c>=0 ) System.out.println("YES");
        else System.out.println("NO");
    }}*/
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String[] l = reader.readLine().split(" ");
        long n = Long.parseLong(l[0]);
        long k = Long.parseLong(l[1]);
        String[] lo = reader.readLine().split(" ");
        if(k>=n){System.out.println(0);}
        else{

            long sum=0;
            long[] list = new long[lo.length];
            for(int i = 0;i<n;i++){
                list[i] = Long.parseLong(lo[i]);
            }
            Arrays.sort(list);
            for(int i = 0;i<n-k;i++){
                sum += list[i];
            }
            System.out.println(sum);
    }
    }
} Main
import javax.swing.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Collections;


public class Main {
    /*public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int q = Integer.parseInt(reader.readLine());
        while(q>0){
            q--;
        String[] l = reader.readLine().split(" ");
        int a = Integer.parseInt(l[0]);
        int b = Integer.parseInt(l[1]);
        int c = Integer.parseInt(l[2]);
        int n = Integer.parseInt(l[3]);
        int p=(a+b+c+n)/3;
        if((a+b+c+n)%3==0 && p-a>=0 && p-b>=0 && p-c>=0 ) System.out.println("YES");
        else System.out.println("NO");
    }}*/
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String[] l = reader.readLine().split(" ");
        long n = Long.parseLong(l[0]);
        long k = Long.parseLong(l[1]);
        String[] lo = reader.readLine().split(" ");
        if(k>=n){System.out.println(0);}
        else{

            long sum=0;
            long[] list = new long[lo.length];
            for(int i = 0;i<n;i++){
                list[i] = Long.parseLong(lo[i]);
            }
            Arrays.sort(list);
            for(int i = 0;i<n-k;i++){
                sum += list[i];
            }
            System.out.println(sum);
    }
    }
}

