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

		// pwr の高い法からk回必殺攻撃
		int rest = n-k;
		long regAttacks = 0;
		for (int i=0; i<rest;i++) {
			regAttacks+=pwr[i];
		}
		
		log(regAttacks);
		sc.close();
	}

	static void log(String s) {
		System.out.println(s);
	}

	static void log(int i) {
		System.out.println(i);
	}

	static void log(long i) {
		System.out.println(i);
	}

	static void log(double d) {
		System.out.printf("%.12f\n",d);
	}
	
} 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();
		
		long [] pwr = new long[n];
		
		for (int i=0;i<n; i++) {
			pwr[i] = sc.nextLong();
		}
		Arrays.sort(pwr);

		// pwr の高い法からk回必殺攻撃
		int rest = n-k;
		long regAttacks = 0;
		for (int i=0; i<rest;i++) {
			regAttacks+=pwr[i];
		}
		
		log(regAttacks);
		sc.close();
	}

	static void log(String s) {
		System.out.println(s);
	}

	static void log(int i) {
		System.out.println(i);
	}

	static void log(long i) {
		System.out.println(i);
	}

	static void log(double d) {
		System.out.printf("%.12f\n",d);
	}
	
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int k = sc.nextInt();
		
		long [] pwr = new long[n];
		
		for (int i=0;i<n; i++) {
			pwr[i] = sc.nextLong();
		}
		Arrays.sort(pwr);

		// pwr の高い法からk回必殺攻撃
		int rest = n-k;
		long regAttacks = 0;
		for (int i=0; i<rest;i++) {
			regAttacks+=pwr[i];
		}
		
		log(regAttacks);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int k = sc.nextInt();
		
		long [] pwr = new long[n];
		
		for (int i=0;i<n; i++) {
			pwr[i] = sc.nextLong();
		}
		Arrays.sort(pwr);

		// pwr の高い法からk回必殺攻撃
		int rest = n-k;
		long regAttacks = 0;
		for (int i=0; i<rest;i++) {
			regAttacks+=pwr[i];
		}
		
		log(regAttacks);
		sc.close();
	} 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 long [] pwr = new long[n]; pwr new long[n] n for (int i=0;i<n; i++) {
			pwr[i] = sc.nextLong();
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			pwr[i] = sc.nextLong();
		} {
			pwr[i] = sc.nextLong();
		} pwr[i] = sc.nextLong() pwr[i] pwr i sc.nextLong() sc.nextLong sc Arrays.sort(pwr) Arrays.sort Arrays pwr int rest = n-k; rest n-k n k long regAttacks = 0; regAttacks 0 for (int i=0; i<rest;i++) {
			regAttacks+=pwr[i];
		} int i=0; int i=0; i 0 i<rest i rest i++ i++ i {
			regAttacks+=pwr[i];
		} {
			regAttacks+=pwr[i];
		} regAttacks+=pwr[i] regAttacks pwr[i] pwr i log(regAttacks) log regAttacks sc.close() sc.close sc String[] args args static void log(String s) {
		System.out.println(s);
	} log {
		System.out.println(s);
	} System.out.println(s) System.out.println System.out System System.out s String s s static void log(int i) {
		System.out.println(i);
	} log {
		System.out.println(i);
	} System.out.println(i) System.out.println System.out System System.out i int i i static void log(long i) {
		System.out.println(i);
	} log {
		System.out.println(i);
	} System.out.println(i) System.out.println System.out System System.out i long i i static void log(double d) {
		System.out.printf("%.12f\n",d);
	} log {
		System.out.printf("%.12f\n",d);
	} System.out.printf("%.12f\n",d) System.out.printf System.out System System.out "%.12f\n" d double d d public class Main {

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

		// pwr の高い法からk回必殺攻撃
		int rest = n-k;
		long regAttacks = 0;
		for (int i=0; i<rest;i++) {
			regAttacks+=pwr[i];
		}
		
		log(regAttacks);
		sc.close();
	}

	static void log(String s) {
		System.out.println(s);
	}

	static void log(int i) {
		System.out.println(i);
	}

	static void log(long i) {
		System.out.println(i);
	}

	static void log(double d) {
		System.out.printf("%.12f\n",d);
	}
	
} public class Main {

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

		// pwr の高い法からk回必殺攻撃
		int rest = n-k;
		long regAttacks = 0;
		for (int i=0; i<rest;i++) {
			regAttacks+=pwr[i];
		}
		
		log(regAttacks);
		sc.close();
	}

	static void log(String s) {
		System.out.println(s);
	}

	static void log(int i) {
		System.out.println(i);
	}

	static void log(long i) {
		System.out.println(i);
	}

	static void log(double d) {
		System.out.printf("%.12f\n",d);
	}
	
} 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();
		
		long [] pwr = new long[n];
		
		for (int i=0;i<n; i++) {
			pwr[i] = sc.nextLong();
		}
		Arrays.sort(pwr);

		// pwr の高い法からk回必殺攻撃
		int rest = n-k;
		long regAttacks = 0;
		for (int i=0; i<rest;i++) {
			regAttacks+=pwr[i];
		}
		
		log(regAttacks);
		sc.close();
	}

	static void log(String s) {
		System.out.println(s);
	}

	static void log(int i) {
		System.out.println(i);
	}

	static void log(long i) {
		System.out.println(i);
	}

	static void log(double d) {
		System.out.printf("%.12f\n",d);
	}
	
}
