import java.util.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Arrays;

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

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