import java.util.Scanner;
import java.util.Arrays;
public class Main{
    public static void main(String[]args){
        Scanner scan = new Scanner(System.in);
        int k,n;
        long sum;
        n=scan.nextInt();
        k=scan.nextInt();
        sum=0;
        long[] arr = new long[n];
        for(int i=0;i<arr.length;i++){
            arr[i]=scan.nextInt();
        }
        Arrays.sort(arr);
        n-=k;
        for(int i=0;i<n;i++){
            sum+=arr[i];
        }
        System.out.println(sum);
    }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util public class Main{
    public static void main(String[]args){
        Scanner scan = new Scanner(System.in);
        int k,n;
        long sum;
        n=scan.nextInt();
        k=scan.nextInt();
        sum=0;
        long[] arr = new long[n];
        for(int i=0;i<arr.length;i++){
            arr[i]=scan.nextInt();
        }
        Arrays.sort(arr);
        n-=k;
        for(int i=0;i<n;i++){
            sum+=arr[i];
        }
        System.out.println(sum);
    }
} Main public static void main(String[]args){
        Scanner scan = new Scanner(System.in);
        int k,n;
        long sum;
        n=scan.nextInt();
        k=scan.nextInt();
        sum=0;
        long[] arr = new long[n];
        for(int i=0;i<arr.length;i++){
            arr[i]=scan.nextInt();
        }
        Arrays.sort(arr);
        n-=k;
        for(int i=0;i<n;i++){
            sum+=arr[i];
        }
        System.out.println(sum);
    } main {
        Scanner scan = new Scanner(System.in);
        int k,n;
        long sum;
        n=scan.nextInt();
        k=scan.nextInt();
        sum=0;
        long[] arr = new long[n];
        for(int i=0;i<arr.length;i++){
            arr[i]=scan.nextInt();
        }
        Arrays.sort(arr);
        n-=k;
        for(int i=0;i<n;i++){
            sum+=arr[i];
        }
        System.out.println(sum);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int k k n; n long sum; sum n=scan.nextInt() n scan.nextInt() scan.nextInt scan k=scan.nextInt() k scan.nextInt() scan.nextInt scan sum=0 sum 0 long[] arr = new long[n]; arr new long[n] n for(int i=0;i<arr.length;i++){
            arr[i]=scan.nextInt();
        } int i=0; int i=0; i 0 i<arr.length i arr.length arr arr.length i++ i++ i {
            arr[i]=scan.nextInt();
        } {
            arr[i]=scan.nextInt();
        } arr[i]=scan.nextInt() arr[i] arr i scan.nextInt() scan.nextInt scan Arrays.sort(arr) Arrays.sort Arrays arr n-=k n k for(int i=0;i<n;i++){
            sum+=arr[i];
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            sum+=arr[i];
        } {
            sum+=arr[i];
        } sum+=arr[i] sum arr[i] arr 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 scan = new Scanner(System.in);
        int k,n;
        long sum;
        n=scan.nextInt();
        k=scan.nextInt();
        sum=0;
        long[] arr = new long[n];
        for(int i=0;i<arr.length;i++){
            arr[i]=scan.nextInt();
        }
        Arrays.sort(arr);
        n-=k;
        for(int i=0;i<n;i++){
            sum+=arr[i];
        }
        System.out.println(sum);
    }
} public class Main{
    public static void main(String[]args){
        Scanner scan = new Scanner(System.in);
        int k,n;
        long sum;
        n=scan.nextInt();
        k=scan.nextInt();
        sum=0;
        long[] arr = new long[n];
        for(int i=0;i<arr.length;i++){
            arr[i]=scan.nextInt();
        }
        Arrays.sort(arr);
        n-=k;
        for(int i=0;i<n;i++){
            sum+=arr[i];
        }
        System.out.println(sum);
    }
} Main
import java.util.Scanner;
import java.util.Arrays;
public class Main{
    public static void main(String[]args){
        Scanner scan = new Scanner(System.in);
        int k,n;
        long sum;
        n=scan.nextInt();
        k=scan.nextInt();
        sum=0;
        long[] arr = new long[n];
        for(int i=0;i<arr.length;i++){
            arr[i]=scan.nextInt();
        }
        Arrays.sort(arr);
        n-=k;
        for(int i=0;i<n;i++){
            sum+=arr[i];
        }
        System.out.println(sum);
    }
}