import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int monster = sc.nextInt();
		int teck = sc.nextInt();

		Integer[] HP = new Integer[monster];
		int[] anser = new int[monster];
		long count = 0;
		for(int i = 0; i <monster; i++) {
			HP[i] = sc.nextInt();
		}
		//降順に並び替え
		Arrays.sort(HP, Collections.reverseOrder());
//		一番多いHPの持つモンスターに必殺技を与える。
//		それ以外はHP-1を行う
		for(int i = 0 ; i<HP.length; i++) {
			if(teck > 0) {
				HP[i] = 0;
				teck -= 1;
			}else {
				count += HP[i];
				HP[i] = 0;
			}
		}
		System.out.println(count);
	}
} import java.util.Arrays; Arrays java.util import java.util.Collections; Collections 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 monster = sc.nextInt();
		int teck = sc.nextInt();

		Integer[] HP = new Integer[monster];
		int[] anser = new int[monster];
		long count = 0;
		for(int i = 0; i <monster; i++) {
			HP[i] = sc.nextInt();
		}
		//降順に並び替え
		Arrays.sort(HP, Collections.reverseOrder());
//		一番多いHPの持つモンスターに必殺技を与える。
//		それ以外はHP-1を行う
		for(int i = 0 ; i<HP.length; i++) {
			if(teck > 0) {
				HP[i] = 0;
				teck -= 1;
			}else {
				count += HP[i];
				HP[i] = 0;
			}
		}
		System.out.println(count);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int monster = sc.nextInt();
		int teck = sc.nextInt();

		Integer[] HP = new Integer[monster];
		int[] anser = new int[monster];
		long count = 0;
		for(int i = 0; i <monster; i++) {
			HP[i] = sc.nextInt();
		}
		//降順に並び替え
		Arrays.sort(HP, Collections.reverseOrder());
//		一番多いHPの持つモンスターに必殺技を与える。
//		それ以外はHP-1を行う
		for(int i = 0 ; i<HP.length; i++) {
			if(teck > 0) {
				HP[i] = 0;
				teck -= 1;
			}else {
				count += HP[i];
				HP[i] = 0;
			}
		}
		System.out.println(count);
	} main {
		Scanner sc = new Scanner(System.in);

		int monster = sc.nextInt();
		int teck = sc.nextInt();

		Integer[] HP = new Integer[monster];
		int[] anser = new int[monster];
		long count = 0;
		for(int i = 0; i <monster; i++) {
			HP[i] = sc.nextInt();
		}
		//降順に並び替え
		Arrays.sort(HP, Collections.reverseOrder());
//		一番多いHPの持つモンスターに必殺技を与える。
//		それ以外はHP-1を行う
		for(int i = 0 ; i<HP.length; i++) {
			if(teck > 0) {
				HP[i] = 0;
				teck -= 1;
			}else {
				count += HP[i];
				HP[i] = 0;
			}
		}
		System.out.println(count);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int monster = sc.nextInt(); monster sc.nextInt() sc.nextInt sc int teck = sc.nextInt(); teck sc.nextInt() sc.nextInt sc Integer[] HP = new Integer[monster]; HP new Integer[monster] monster int[] anser = new int[monster]; anser new int[monster] monster long count = 0; count 0 for(int i = 0; i <monster; i++) {
			HP[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i <monster i monster 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 for(int i = 0 ; i<HP.length; i++) {
			if(teck > 0) {
				HP[i] = 0;
				teck -= 1;
			}else {
				count += HP[i];
				HP[i] = 0;
			}
		} int i = 0 ; int i = 0 ; i 0 i<HP.length i HP.length HP HP.length i++ i++ i {
			if(teck > 0) {
				HP[i] = 0;
				teck -= 1;
			}else {
				count += HP[i];
				HP[i] = 0;
			}
		} {
			if(teck > 0) {
				HP[i] = 0;
				teck -= 1;
			}else {
				count += HP[i];
				HP[i] = 0;
			}
		} if(teck > 0) {
				HP[i] = 0;
				teck -= 1;
			}else {
				count += HP[i];
				HP[i] = 0;
			} teck > 0 teck 0 {
				HP[i] = 0;
				teck -= 1;
			} HP[i] = 0 HP[i] HP i 0 teck -= 1 teck 1 {
				count += HP[i];
				HP[i] = 0;
			} count += HP[i] count HP[i] HP i HP[i] = 0 HP[i] HP i 0 System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int monster = sc.nextInt();
		int teck = sc.nextInt();

		Integer[] HP = new Integer[monster];
		int[] anser = new int[monster];
		long count = 0;
		for(int i = 0; i <monster; i++) {
			HP[i] = sc.nextInt();
		}
		//降順に並び替え
		Arrays.sort(HP, Collections.reverseOrder());
//		一番多いHPの持つモンスターに必殺技を与える。
//		それ以外はHP-1を行う
		for(int i = 0 ; i<HP.length; i++) {
			if(teck > 0) {
				HP[i] = 0;
				teck -= 1;
			}else {
				count += HP[i];
				HP[i] = 0;
			}
		}
		System.out.println(count);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int monster = sc.nextInt();
		int teck = sc.nextInt();

		Integer[] HP = new Integer[monster];
		int[] anser = new int[monster];
		long count = 0;
		for(int i = 0; i <monster; i++) {
			HP[i] = sc.nextInt();
		}
		//降順に並び替え
		Arrays.sort(HP, Collections.reverseOrder());
//		一番多いHPの持つモンスターに必殺技を与える。
//		それ以外はHP-1を行う
		for(int i = 0 ; i<HP.length; i++) {
			if(teck > 0) {
				HP[i] = 0;
				teck -= 1;
			}else {
				count += HP[i];
				HP[i] = 0;
			}
		}
		System.out.println(count);
	}
} Main
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int monster = sc.nextInt();
		int teck = sc.nextInt();

		Integer[] HP = new Integer[monster];
		int[] anser = new int[monster];
		long count = 0;
		for(int i = 0; i <monster; i++) {
			HP[i] = sc.nextInt();
		}
		//降順に並び替え
		Arrays.sort(HP, Collections.reverseOrder());
//		一番多いHPの持つモンスターに必殺技を与える。
//		それ以外はHP-1を行う
		for(int i = 0 ; i<HP.length; i++) {
			if(teck > 0) {
				HP[i] = 0;
				teck -= 1;
			}else {
				count += HP[i];
				HP[i] = 0;
			}
		}
		System.out.println(count);
	}
}
