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 = sc.nextInt();
		int k = sc.nextInt();
		int[] monsters =new int[n];
		for (int i=0;i<n;i++){
			monsters[i]=sc.nextInt();
		}
		Arrays.sort(monsters);

		long hp =0;
		if (k>=n) {
			System.out.println(hp);
		} else{
			for (int j=0;j<n-k;j++) {
				hp += monsters[j];
			}
			System.out.println(hp);

		}



		//------------------------------------------------------------
	}
} 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 = sc.nextInt();
		int k = sc.nextInt();
		int[] monsters =new int[n];
		for (int i=0;i<n;i++){
			monsters[i]=sc.nextInt();
		}
		Arrays.sort(monsters);

		long hp =0;
		if (k>=n) {
			System.out.println(hp);
		} else{
			for (int j=0;j<n-k;j++) {
				hp += monsters[j];
			}
			System.out.println(hp);

		}



		//------------------------------------------------------------
	}
} Main public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
//------------------------------------------------------------
		int n = sc.nextInt();
		int k = sc.nextInt();
		int[] monsters =new int[n];
		for (int i=0;i<n;i++){
			monsters[i]=sc.nextInt();
		}
		Arrays.sort(monsters);

		long hp =0;
		if (k>=n) {
			System.out.println(hp);
		} else{
			for (int j=0;j<n-k;j++) {
				hp += monsters[j];
			}
			System.out.println(hp);

		}



		//------------------------------------------------------------
	} main {
		Scanner sc = new Scanner(System.in);
//------------------------------------------------------------
		int n = sc.nextInt();
		int k = sc.nextInt();
		int[] monsters =new int[n];
		for (int i=0;i<n;i++){
			monsters[i]=sc.nextInt();
		}
		Arrays.sort(monsters);

		long hp =0;
		if (k>=n) {
			System.out.println(hp);
		} else{
			for (int j=0;j<n-k;j++) {
				hp += monsters[j];
			}
			System.out.println(hp);

		}



		//------------------------------------------------------------
	} 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 int[] monsters =new int[n]; monsters new int[n] n for (int i=0;i<n;i++){
			monsters[i]=sc.nextInt();
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			monsters[i]=sc.nextInt();
		} {
			monsters[i]=sc.nextInt();
		} monsters[i]=sc.nextInt() monsters[i] monsters i sc.nextInt() sc.nextInt sc Arrays.sort(monsters) Arrays.sort Arrays monsters long hp =0; hp 0 if (k>=n) {
			System.out.println(hp);
		} else{
			for (int j=0;j<n-k;j++) {
				hp += monsters[j];
			}
			System.out.println(hp);

		} k>=n k n {
			System.out.println(hp);
		} System.out.println(hp) System.out.println System.out System System.out hp {
			for (int j=0;j<n-k;j++) {
				hp += monsters[j];
			}
			System.out.println(hp);

		} for (int j=0;j<n-k;j++) {
				hp += monsters[j];
			} int j=0; int j=0; j 0 j<n-k j n-k n k j++ j++ j {
				hp += monsters[j];
			} {
				hp += monsters[j];
			} hp += monsters[j] hp monsters[j] monsters j System.out.println(hp) System.out.println System.out System System.out hp 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();
		int[] monsters =new int[n];
		for (int i=0;i<n;i++){
			monsters[i]=sc.nextInt();
		}
		Arrays.sort(monsters);

		long hp =0;
		if (k>=n) {
			System.out.println(hp);
		} else{
			for (int j=0;j<n-k;j++) {
				hp += monsters[j];
			}
			System.out.println(hp);

		}



		//------------------------------------------------------------
	}
} public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
//------------------------------------------------------------
		int n = sc.nextInt();
		int k = sc.nextInt();
		int[] monsters =new int[n];
		for (int i=0;i<n;i++){
			monsters[i]=sc.nextInt();
		}
		Arrays.sort(monsters);

		long hp =0;
		if (k>=n) {
			System.out.println(hp);
		} else{
			for (int j=0;j<n-k;j++) {
				hp += monsters[j];
			}
			System.out.println(hp);

		}



		//------------------------------------------------------------
	}
} 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 = sc.nextInt();
		int k = sc.nextInt();
		int[] monsters =new int[n];
		for (int i=0;i<n;i++){
			monsters[i]=sc.nextInt();
		}
		Arrays.sort(monsters);

		long hp =0;
		if (k>=n) {
			System.out.println(hp);
		} else{
			for (int j=0;j<n-k;j++) {
				hp += monsters[j];
			}
			System.out.println(hp);

		}



		//------------------------------------------------------------
	}
}