import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.LongStream;

public class Main {
    public static void main(String[]args){
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        int K=sc.nextInt();
        long [] healths=new long[N];
        int sum_of_moves=0;
        for(int i=0;i<N;i++)
           healths[i]=sc.nextLong();
        Arrays.sort(healths);
      //  String output=(sum_of_moves>=H)?"Yes":"No";
        System.out.print((N>K)? LongStream.of(Arrays.copyOfRange(healths,0,healths.length-K)).sum():0);
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util import java.util.stream.LongStream; LongStream java.util.stream public class Main {
    public static void main(String[]args){
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        int K=sc.nextInt();
        long [] healths=new long[N];
        int sum_of_moves=0;
        for(int i=0;i<N;i++)
           healths[i]=sc.nextLong();
        Arrays.sort(healths);
      //  String output=(sum_of_moves>=H)?"Yes":"No";
        System.out.print((N>K)? LongStream.of(Arrays.copyOfRange(healths,0,healths.length-K)).sum():0);
    }
} Main public static void main(String[]args){
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        int K=sc.nextInt();
        long [] healths=new long[N];
        int sum_of_moves=0;
        for(int i=0;i<N;i++)
           healths[i]=sc.nextLong();
        Arrays.sort(healths);
      //  String output=(sum_of_moves>=H)?"Yes":"No";
        System.out.print((N>K)? LongStream.of(Arrays.copyOfRange(healths,0,healths.length-K)).sum():0);
    } main {
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        int K=sc.nextInt();
        long [] healths=new long[N];
        int sum_of_moves=0;
        for(int i=0;i<N;i++)
           healths[i]=sc.nextLong();
        Arrays.sort(healths);
      //  String output=(sum_of_moves>=H)?"Yes":"No";
        System.out.print((N>K)? LongStream.of(Arrays.copyOfRange(healths,0,healths.length-K)).sum():0);
    } 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 [] healths=new long[N]; healths new long[N] N int sum_of_moves=0; sum_of_moves 0 for(int i=0;i<N;i++)
           healths[i]=sc.nextLong(); int i=0; int i=0; i 0 i<N i N i++ i++ i healths[i]=sc.nextLong(); healths[i]=sc.nextLong() healths[i] healths i sc.nextLong() sc.nextLong sc Arrays.sort(healths) Arrays.sort Arrays healths System.out.print((N>K)? LongStream.of(Arrays.copyOfRange(healths,0,healths.length-K)).sum():0) System.out.print System.out System System.out (N>K)? LongStream.of(Arrays.copyOfRange(healths,0,healths.length-K)).sum():0 (N>K) N K LongStream.of(Arrays.copyOfRange(healths,0,healths.length-K)).sum() LongStream.of(Arrays.copyOfRange(healths,0,healths.length-K)).sum LongStream.of(Arrays.copyOfRange(healths,0,healths.length-K)) LongStream.of LongStream Arrays.copyOfRange(healths,0,healths.length-K) Arrays.copyOfRange Arrays healths 0 healths.length-K healths.length healths healths.length K 0 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 [] healths=new long[N];
        int sum_of_moves=0;
        for(int i=0;i<N;i++)
           healths[i]=sc.nextLong();
        Arrays.sort(healths);
      //  String output=(sum_of_moves>=H)?"Yes":"No";
        System.out.print((N>K)? LongStream.of(Arrays.copyOfRange(healths,0,healths.length-K)).sum():0);
    }
} public class Main {
    public static void main(String[]args){
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        int K=sc.nextInt();
        long [] healths=new long[N];
        int sum_of_moves=0;
        for(int i=0;i<N;i++)
           healths[i]=sc.nextLong();
        Arrays.sort(healths);
      //  String output=(sum_of_moves>=H)?"Yes":"No";
        System.out.print((N>K)? LongStream.of(Arrays.copyOfRange(healths,0,healths.length-K)).sum():0);
    }
} Main
import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.LongStream;

public class Main {
    public static void main(String[]args){
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        int K=sc.nextInt();
        long [] healths=new long[N];
        int sum_of_moves=0;
        for(int i=0;i<N;i++)
           healths[i]=sc.nextLong();
        Arrays.sort(healths);
      //  String output=(sum_of_moves>=H)?"Yes":"No";
        System.out.print((N>K)? LongStream.of(Arrays.copyOfRange(healths,0,healths.length-K)).sum():0);
    }
}