import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);
		int monsterCount = sc.nextInt();
		int extraAttackCount = sc.nextInt();
		long answer = 0;

		int[] monsterArray = new int[monsterCount];
		for(int i = 0; i < monsterCount; i++) {
			monsterArray[i] = sc.nextInt();
		}
		Arrays.sort(monsterArray);

		for(int i =0; i < monsterCount -extraAttackCount; i++) {
			answer += monsterArray[i];
		}
		System.out.println(answer);
	}
} 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 monsterCount = sc.nextInt();
		int extraAttackCount = sc.nextInt();
		long answer = 0;

		int[] monsterArray = new int[monsterCount];
		for(int i = 0; i < monsterCount; i++) {
			monsterArray[i] = sc.nextInt();
		}
		Arrays.sort(monsterArray);

		for(int i =0; i < monsterCount -extraAttackCount; i++) {
			answer += monsterArray[i];
		}
		System.out.println(answer);
	}
} Main public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);
		int monsterCount = sc.nextInt();
		int extraAttackCount = sc.nextInt();
		long answer = 0;

		int[] monsterArray = new int[monsterCount];
		for(int i = 0; i < monsterCount; i++) {
			monsterArray[i] = sc.nextInt();
		}
		Arrays.sort(monsterArray);

		for(int i =0; i < monsterCount -extraAttackCount; i++) {
			answer += monsterArray[i];
		}
		System.out.println(answer);
	} main {


		Scanner sc = new Scanner(System.in);
		int monsterCount = sc.nextInt();
		int extraAttackCount = sc.nextInt();
		long answer = 0;

		int[] monsterArray = new int[monsterCount];
		for(int i = 0; i < monsterCount; i++) {
			monsterArray[i] = sc.nextInt();
		}
		Arrays.sort(monsterArray);

		for(int i =0; i < monsterCount -extraAttackCount; i++) {
			answer += monsterArray[i];
		}
		System.out.println(answer);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int monsterCount = sc.nextInt(); monsterCount sc.nextInt() sc.nextInt sc int extraAttackCount = sc.nextInt(); extraAttackCount sc.nextInt() sc.nextInt sc long answer = 0; answer 0 int[] monsterArray = new int[monsterCount]; monsterArray new int[monsterCount] monsterCount for(int i = 0; i < monsterCount; i++) {
			monsterArray[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < monsterCount i monsterCount i++ i++ i {
			monsterArray[i] = sc.nextInt();
		} {
			monsterArray[i] = sc.nextInt();
		} monsterArray[i] = sc.nextInt() monsterArray[i] monsterArray i sc.nextInt() sc.nextInt sc Arrays.sort(monsterArray) Arrays.sort Arrays monsterArray for(int i =0; i < monsterCount -extraAttackCount; i++) {
			answer += monsterArray[i];
		} int i =0; int i =0; i 0 i < monsterCount -extraAttackCount i monsterCount -extraAttackCount monsterCount extraAttackCount i++ i++ i {
			answer += monsterArray[i];
		} {
			answer += monsterArray[i];
		} answer += monsterArray[i] answer monsterArray[i] monsterArray i System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {

	public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);
		int monsterCount = sc.nextInt();
		int extraAttackCount = sc.nextInt();
		long answer = 0;

		int[] monsterArray = new int[monsterCount];
		for(int i = 0; i < monsterCount; i++) {
			monsterArray[i] = sc.nextInt();
		}
		Arrays.sort(monsterArray);

		for(int i =0; i < monsterCount -extraAttackCount; i++) {
			answer += monsterArray[i];
		}
		System.out.println(answer);
	}
} public class Main {

	public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);
		int monsterCount = sc.nextInt();
		int extraAttackCount = sc.nextInt();
		long answer = 0;

		int[] monsterArray = new int[monsterCount];
		for(int i = 0; i < monsterCount; i++) {
			monsterArray[i] = sc.nextInt();
		}
		Arrays.sort(monsterArray);

		for(int i =0; i < monsterCount -extraAttackCount; i++) {
			answer += monsterArray[i];
		}
		System.out.println(answer);
	}
} 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 monsterCount = sc.nextInt();
		int extraAttackCount = sc.nextInt();
		long answer = 0;

		int[] monsterArray = new int[monsterCount];
		for(int i = 0; i < monsterCount; i++) {
			monsterArray[i] = sc.nextInt();
		}
		Arrays.sort(monsterArray);

		for(int i =0; i < monsterCount -extraAttackCount; i++) {
			answer += monsterArray[i];
		}
		System.out.println(answer);
	}
}
