import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int teki = sc.nextInt();
		int waza = sc.nextInt();
      	long ret = 0;
      	int[] hoge = new int[teki];
      	if (teki <= waza){
        	System.out.println(0);
          	return;
        }
		for (int i = 0; i < teki; i++){
			hoge[i] = sc.nextInt();
		}
		Arrays.sort(hoge);
		for(int i = 0; i < teki - waza ; i++){
          	ret += hoge[i];
		}
		System.out.print(ret);
	}
} import java.util.*; util.* java class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int teki = sc.nextInt();
		int waza = sc.nextInt();
      	long ret = 0;
      	int[] hoge = new int[teki];
      	if (teki <= waza){
        	System.out.println(0);
          	return;
        }
		for (int i = 0; i < teki; i++){
			hoge[i] = sc.nextInt();
		}
		Arrays.sort(hoge);
		for(int i = 0; i < teki - waza ; i++){
          	ret += hoge[i];
		}
		System.out.print(ret);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int teki = sc.nextInt();
		int waza = sc.nextInt();
      	long ret = 0;
      	int[] hoge = new int[teki];
      	if (teki <= waza){
        	System.out.println(0);
          	return;
        }
		for (int i = 0; i < teki; i++){
			hoge[i] = sc.nextInt();
		}
		Arrays.sort(hoge);
		for(int i = 0; i < teki - waza ; i++){
          	ret += hoge[i];
		}
		System.out.print(ret);
	} main {
		Scanner sc = new Scanner(System.in);
		int teki = sc.nextInt();
		int waza = sc.nextInt();
      	long ret = 0;
      	int[] hoge = new int[teki];
      	if (teki <= waza){
        	System.out.println(0);
          	return;
        }
		for (int i = 0; i < teki; i++){
			hoge[i] = sc.nextInt();
		}
		Arrays.sort(hoge);
		for(int i = 0; i < teki - waza ; i++){
          	ret += hoge[i];
		}
		System.out.print(ret);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int teki = sc.nextInt(); teki sc.nextInt() sc.nextInt sc int waza = sc.nextInt(); waza sc.nextInt() sc.nextInt sc long ret = 0; ret 0 int[] hoge = new int[teki]; hoge new int[teki] teki if (teki <= waza){
        	System.out.println(0);
          	return;
        } teki <= waza teki waza {
        	System.out.println(0);
          	return;
        } System.out.println(0) System.out.println System.out System System.out 0 return; for (int i = 0; i < teki; i++){
			hoge[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < teki i teki i++ i++ i {
			hoge[i] = sc.nextInt();
		} {
			hoge[i] = sc.nextInt();
		} hoge[i] = sc.nextInt() hoge[i] hoge i sc.nextInt() sc.nextInt sc Arrays.sort(hoge) Arrays.sort Arrays hoge for(int i = 0; i < teki - waza ; i++){
          	ret += hoge[i];
		} int i = 0; int i = 0; i 0 i < teki - waza i teki - waza teki waza i++ i++ i {
          	ret += hoge[i];
		} {
          	ret += hoge[i];
		} ret += hoge[i] ret hoge[i] hoge i System.out.print(ret) System.out.print System.out System System.out ret String[] args args
import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int teki = sc.nextInt();
		int waza = sc.nextInt();
      	long ret = 0;
      	int[] hoge = new int[teki];
      	if (teki <= waza){
        	System.out.println(0);
          	return;
        }
		for (int i = 0; i < teki; i++){
			hoge[i] = sc.nextInt();
		}
		Arrays.sort(hoge);
		for(int i = 0; i < teki - waza ; i++){
          	ret += hoge[i];
		}
		System.out.print(ret);
	}
}