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