import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int k=sc.nextInt();
        int po[]=new int[n];
        for(int i=0;i<n;i++){
            po[i]=sc.nextInt();
        }
        Arrays.sort(po);
        long sum=0;
        for(int i=0;i<n-k;i++)sum+=po[i];
        System.out.println(sum);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int k=sc.nextInt();
        int po[]=new int[n];
        for(int i=0;i<n;i++){
            po[i]=sc.nextInt();
        }
        Arrays.sort(po);
        long sum=0;
        for(int i=0;i<n-k;i++)sum+=po[i];
        System.out.println(sum);
    }
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int k=sc.nextInt();
        int po[]=new int[n];
        for(int i=0;i<n;i++){
            po[i]=sc.nextInt();
        }
        Arrays.sort(po);
        long sum=0;
        for(int i=0;i<n-k;i++)sum+=po[i];
        System.out.println(sum);
    } main {
        // Your code here!
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int k=sc.nextInt();
        int po[]=new int[n];
        for(int i=0;i<n;i++){
            po[i]=sc.nextInt();
        }
        Arrays.sort(po);
        long sum=0;
        for(int i=0;i<n-k;i++)sum+=po[i];
        System.out.println(sum);
    } 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 int po[]=new int[n]; po new int[n] n for(int i=0;i<n;i++){
            po[i]=sc.nextInt();
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            po[i]=sc.nextInt();
        } {
            po[i]=sc.nextInt();
        } po[i]=sc.nextInt() po[i] po i sc.nextInt() sc.nextInt sc Arrays.sort(po) Arrays.sort Arrays po long sum=0; sum 0 for(int i=0;i<n-k;i++)sum+=po[i]; int i=0; int i=0; i 0 i<n-k i n-k n k i++ i++ i sum+=po[i]; sum+=po[i] sum po[i] po 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 Exception {
        // Your code here!
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int k=sc.nextInt();
        int po[]=new int[n];
        for(int i=0;i<n;i++){
            po[i]=sc.nextInt();
        }
        Arrays.sort(po);
        long sum=0;
        for(int i=0;i<n-k;i++)sum+=po[i];
        System.out.println(sum);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int k=sc.nextInt();
        int po[]=new int[n];
        for(int i=0;i<n;i++){
            po[i]=sc.nextInt();
        }
        Arrays.sort(po);
        long sum=0;
        for(int i=0;i<n-k;i++)sum+=po[i];
        System.out.println(sum);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int k=sc.nextInt();
        int po[]=new int[n];
        for(int i=0;i<n;i++){
            po[i]=sc.nextInt();
        }
        Arrays.sort(po);
        long sum=0;
        for(int i=0;i<n-k;i++)sum+=po[i];
        System.out.println(sum);
    }
}
