import java.util.Arrays;
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int ex = Integer.parseInt(sc.next());
		int[] teki = new int[n];
		for(int i = 0; i < n; i++){
			teki[i] = Integer.parseInt(sc.next());
		}
		Arrays.sort(teki);
		n -= ex;
		long res = 0L;
		for(int i = 0; i < n; i++){
			res += teki[i];
		}
		System.out.println(res);
	}
	
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int ex = Integer.parseInt(sc.next());
		int[] teki = new int[n];
		for(int i = 0; i < n; i++){
			teki[i] = Integer.parseInt(sc.next());
		}
		Arrays.sort(teki);
		n -= ex;
		long res = 0L;
		for(int i = 0; i < n; i++){
			res += teki[i];
		}
		System.out.println(res);
	}
	
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int ex = Integer.parseInt(sc.next());
		int[] teki = new int[n];
		for(int i = 0; i < n; i++){
			teki[i] = Integer.parseInt(sc.next());
		}
		Arrays.sort(teki);
		n -= ex;
		long res = 0L;
		for(int i = 0; i < n; i++){
			res += teki[i];
		}
		System.out.println(res);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int ex = Integer.parseInt(sc.next());
		int[] teki = new int[n];
		for(int i = 0; i < n; i++){
			teki[i] = Integer.parseInt(sc.next());
		}
		Arrays.sort(teki);
		n -= ex;
		long res = 0L;
		for(int i = 0; i < n; i++){
			res += teki[i];
		}
		System.out.println(res);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int ex = Integer.parseInt(sc.next()); ex Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int[] teki = new int[n]; teki new int[n] n for(int i = 0; i < n; i++){
			teki[i] = Integer.parseInt(sc.next());
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			teki[i] = Integer.parseInt(sc.next());
		} {
			teki[i] = Integer.parseInt(sc.next());
		} teki[i] = Integer.parseInt(sc.next()) teki[i] teki i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Arrays.sort(teki) Arrays.sort Arrays teki n -= ex n ex long res = 0L; res 0L for(int i = 0; i < n; i++){
			res += teki[i];
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			res += teki[i];
		} {
			res += teki[i];
		} res += teki[i] res teki[i] teki i System.out.println(res) System.out.println System.out System System.out res String[] args args public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int ex = Integer.parseInt(sc.next());
		int[] teki = new int[n];
		for(int i = 0; i < n; i++){
			teki[i] = Integer.parseInt(sc.next());
		}
		Arrays.sort(teki);
		n -= ex;
		long res = 0L;
		for(int i = 0; i < n; i++){
			res += teki[i];
		}
		System.out.println(res);
	}
	
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int ex = Integer.parseInt(sc.next());
		int[] teki = new int[n];
		for(int i = 0; i < n; i++){
			teki[i] = Integer.parseInt(sc.next());
		}
		Arrays.sort(teki);
		n -= ex;
		long res = 0L;
		for(int i = 0; i < n; i++){
			res += teki[i];
		}
		System.out.println(res);
	}
	
} Main
import java.util.Arrays;
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int ex = Integer.parseInt(sc.next());
		int[] teki = new int[n];
		for(int i = 0; i < n; i++){
			teki[i] = Integer.parseInt(sc.next());
		}
		Arrays.sort(teki);
		n -= ex;
		long res = 0L;
		for(int i = 0; i < n; i++){
			res += teki[i];
		}
		System.out.println(res);
	}
	
}