import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong();
        long k = scan.nextLong();
        long out = 0;
        long[] h =  new long[(int)n];
        for(int i = 0; i < n; i++){
            h[i] = scan.nextLong();
        }
        Arrays.sort(h);
        for(int i = 0 ; i < n - k; i++){
            out += h[i];
        }
        System.out.println(out);
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong();
        long k = scan.nextLong();
        long out = 0;
        long[] h =  new long[(int)n];
        for(int i = 0; i < n; i++){
            h[i] = scan.nextLong();
        }
        Arrays.sort(h);
        for(int i = 0 ; i < n - k; i++){
            out += h[i];
        }
        System.out.println(out);
    }
} Main public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong();
        long k = scan.nextLong();
        long out = 0;
        long[] h =  new long[(int)n];
        for(int i = 0; i < n; i++){
            h[i] = scan.nextLong();
        }
        Arrays.sort(h);
        for(int i = 0 ; i < n - k; i++){
            out += h[i];
        }
        System.out.println(out);
    } main {
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong();
        long k = scan.nextLong();
        long out = 0;
        long[] h =  new long[(int)n];
        for(int i = 0; i < n; i++){
            h[i] = scan.nextLong();
        }
        Arrays.sort(h);
        for(int i = 0 ; i < n - k; i++){
            out += h[i];
        }
        System.out.println(out);
    } Scanner scan = new java.util.Scanner(System.in); scan new java.util.Scanner(System.in) long n = scan.nextLong(); n scan.nextLong() scan.nextLong scan long k = scan.nextLong(); k scan.nextLong() scan.nextLong scan long out = 0; out 0 long[] h =  new long[(int)n]; h new long[(int)n] (int)n for(int i = 0; i < n; i++){
            h[i] = scan.nextLong();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            h[i] = scan.nextLong();
        } {
            h[i] = scan.nextLong();
        } h[i] = scan.nextLong() h[i] h i scan.nextLong() scan.nextLong scan Arrays.sort(h) Arrays.sort Arrays h for(int i = 0 ; i < n - k; i++){
            out += h[i];
        } int i = 0 ; int i = 0 ; i 0 i < n - k i n - k n k i++ i++ i {
            out += h[i];
        } {
            out += h[i];
        } out += h[i] out h[i] h i System.out.println(out) System.out.println System.out System System.out out String[] args args public class Main{
    public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong();
        long k = scan.nextLong();
        long out = 0;
        long[] h =  new long[(int)n];
        for(int i = 0; i < n; i++){
            h[i] = scan.nextLong();
        }
        Arrays.sort(h);
        for(int i = 0 ; i < n - k; i++){
            out += h[i];
        }
        System.out.println(out);
    }
} public class Main{
    public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong();
        long k = scan.nextLong();
        long out = 0;
        long[] h =  new long[(int)n];
        for(int i = 0; i < n; i++){
            h[i] = scan.nextLong();
        }
        Arrays.sort(h);
        for(int i = 0 ; i < n - k; i++){
            out += h[i];
        }
        System.out.println(out);
    }
} Main
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong();
        long k = scan.nextLong();
        long out = 0;
        long[] h =  new long[(int)n];
        for(int i = 0; i < n; i++){
            h[i] = scan.nextLong();
        }
        Arrays.sort(h);
        for(int i = 0 ; i < n - k; i++){
            out += h[i];
        }
        System.out.println(out);
    }
}