import  java.util.*;


import static java.util.Arrays.*;

public class Main {
    public static void main(String[] args)
    {
        Scanner sc =new Scanner(System.in);
        int a,b;
        a=sc.nextInt();
        b=sc.nextInt();
        int ar[] = new int[a];
        int i, j = 0;
        for (i = 0; i < a; i++) {
            ar[i] = sc.nextInt();
        }
        if(b>=a){
            System.out.println("0");
        }
        else {

            sort(ar);
        
            long  sum = 0;
            for (i = 0; i <a-b; i++) {
                sum = sum + ar[i];
            }

            System.out.println(sum);
        }
    }
} import  java.util.*; util.* java import static java.util.Arrays.*; import static java.util.Arrays.*; import static java.util.Arrays.*; public class Main {
    public static void main(String[] args)
    {
        Scanner sc =new Scanner(System.in);
        int a,b;
        a=sc.nextInt();
        b=sc.nextInt();
        int ar[] = new int[a];
        int i, j = 0;
        for (i = 0; i < a; i++) {
            ar[i] = sc.nextInt();
        }
        if(b>=a){
            System.out.println("0");
        }
        else {

            sort(ar);
        
            long  sum = 0;
            for (i = 0; i <a-b; i++) {
                sum = sum + ar[i];
            }

            System.out.println(sum);
        }
    }
} Main public static void main(String[] args)
    {
        Scanner sc =new Scanner(System.in);
        int a,b;
        a=sc.nextInt();
        b=sc.nextInt();
        int ar[] = new int[a];
        int i, j = 0;
        for (i = 0; i < a; i++) {
            ar[i] = sc.nextInt();
        }
        if(b>=a){
            System.out.println("0");
        }
        else {

            sort(ar);
        
            long  sum = 0;
            for (i = 0; i <a-b; i++) {
                sum = sum + ar[i];
            }

            System.out.println(sum);
        }
    } main {
        Scanner sc =new Scanner(System.in);
        int a,b;
        a=sc.nextInt();
        b=sc.nextInt();
        int ar[] = new int[a];
        int i, j = 0;
        for (i = 0; i < a; i++) {
            ar[i] = sc.nextInt();
        }
        if(b>=a){
            System.out.println("0");
        }
        else {

            sort(ar);
        
            long  sum = 0;
            for (i = 0; i <a-b; i++) {
                sum = sum + ar[i];
            }

            System.out.println(sum);
        }
    } Scanner sc =new Scanner(System.in); sc new Scanner(System.in) int a a b; b a=sc.nextInt() a sc.nextInt() sc.nextInt sc b=sc.nextInt() b sc.nextInt() sc.nextInt sc int ar[] = new int[a]; ar new int[a] a int i i j = 0; j 0 for (i = 0; i < a; i++) {
            ar[i] = sc.nextInt();
        } i = 0; i = 0 i 0 i < a i a i++ i++ i {
            ar[i] = sc.nextInt();
        } {
            ar[i] = sc.nextInt();
        } ar[i] = sc.nextInt() ar[i] ar i sc.nextInt() sc.nextInt sc if(b>=a){
            System.out.println("0");
        }
        else {

            sort(ar);
        
            long  sum = 0;
            for (i = 0; i <a-b; i++) {
                sum = sum + ar[i];
            }

            System.out.println(sum);
        } b>=a b a {
            System.out.println("0");
        } System.out.println("0") System.out.println System.out System System.out "0" {

            sort(ar);
        
            long  sum = 0;
            for (i = 0; i <a-b; i++) {
                sum = sum + ar[i];
            }

            System.out.println(sum);
        } sort(ar) sort ar long  sum = 0; sum 0 for (i = 0; i <a-b; i++) {
                sum = sum + ar[i];
            } i = 0; i = 0 i 0 i <a-b i a-b a b i++ i++ i {
                sum = sum + ar[i];
            } {
                sum = sum + ar[i];
            } sum = sum + ar[i] sum sum + ar[i] sum ar[i] ar 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 sc =new Scanner(System.in);
        int a,b;
        a=sc.nextInt();
        b=sc.nextInt();
        int ar[] = new int[a];
        int i, j = 0;
        for (i = 0; i < a; i++) {
            ar[i] = sc.nextInt();
        }
        if(b>=a){
            System.out.println("0");
        }
        else {

            sort(ar);
        
            long  sum = 0;
            for (i = 0; i <a-b; i++) {
                sum = sum + ar[i];
            }

            System.out.println(sum);
        }
    }
} public class Main {
    public static void main(String[] args)
    {
        Scanner sc =new Scanner(System.in);
        int a,b;
        a=sc.nextInt();
        b=sc.nextInt();
        int ar[] = new int[a];
        int i, j = 0;
        for (i = 0; i < a; i++) {
            ar[i] = sc.nextInt();
        }
        if(b>=a){
            System.out.println("0");
        }
        else {

            sort(ar);
        
            long  sum = 0;
            for (i = 0; i <a-b; i++) {
                sum = sum + ar[i];
            }

            System.out.println(sum);
        }
    }
} Main
import  java.util.*;


import static java.util.Arrays.*;

public class Main {
    public static void main(String[] args)
    {
        Scanner sc =new Scanner(System.in);
        int a,b;
        a=sc.nextInt();
        b=sc.nextInt();
        int ar[] = new int[a];
        int i, j = 0;
        for (i = 0; i < a; i++) {
            ar[i] = sc.nextInt();
        }
        if(b>=a){
            System.out.println("0");
        }
        else {

            sort(ar);
        
            long  sum = 0;
            for (i = 0; i <a-b; i++) {
                sum = sum + ar[i];
            }

            System.out.println(sum);
        }
    }
}