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

public class Main{

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		String[] temp   = scanner.nextLine().split(" ");
		int n = Integer.parseInt(temp[0]);
		int k = Integer.parseInt(temp[1]);
		String[] temp2  = scanner.nextLine().split(" ");
		Long[] mlist     = new Long[n];

		for(int i = 0; i < n; i++) {

			mlist[i] = Long.parseLong(temp2[i]);

		}

		Arrays.sort(mlist,Collections.reverseOrder());
		long sum = 0;

		for(int i = 0; i < n; i++) {

			if(i >= k) {

				sum += mlist[i];

			}


		}

		System.out.println(sum);

	}

} 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 scanner = new Scanner(System.in);
		String[] temp   = scanner.nextLine().split(" ");
		int n = Integer.parseInt(temp[0]);
		int k = Integer.parseInt(temp[1]);
		String[] temp2  = scanner.nextLine().split(" ");
		Long[] mlist     = new Long[n];

		for(int i = 0; i < n; i++) {

			mlist[i] = Long.parseLong(temp2[i]);

		}

		Arrays.sort(mlist,Collections.reverseOrder());
		long sum = 0;

		for(int i = 0; i < n; i++) {

			if(i >= k) {

				sum += mlist[i];

			}


		}

		System.out.println(sum);

	}

} Main public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		String[] temp   = scanner.nextLine().split(" ");
		int n = Integer.parseInt(temp[0]);
		int k = Integer.parseInt(temp[1]);
		String[] temp2  = scanner.nextLine().split(" ");
		Long[] mlist     = new Long[n];

		for(int i = 0; i < n; i++) {

			mlist[i] = Long.parseLong(temp2[i]);

		}

		Arrays.sort(mlist,Collections.reverseOrder());
		long sum = 0;

		for(int i = 0; i < n; i++) {

			if(i >= k) {

				sum += mlist[i];

			}


		}

		System.out.println(sum);

	} main {

		Scanner scanner = new Scanner(System.in);
		String[] temp   = scanner.nextLine().split(" ");
		int n = Integer.parseInt(temp[0]);
		int k = Integer.parseInt(temp[1]);
		String[] temp2  = scanner.nextLine().split(" ");
		Long[] mlist     = new Long[n];

		for(int i = 0; i < n; i++) {

			mlist[i] = Long.parseLong(temp2[i]);

		}

		Arrays.sort(mlist,Collections.reverseOrder());
		long sum = 0;

		for(int i = 0; i < n; i++) {

			if(i >= k) {

				sum += mlist[i];

			}


		}

		System.out.println(sum);

	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String[] temp   = scanner.nextLine().split(" "); temp scanner.nextLine().split(" ") scanner.nextLine().split scanner.nextLine() scanner.nextLine scanner " " int n = Integer.parseInt(temp[0]); n Integer.parseInt(temp[0]) Integer.parseInt Integer temp[0] temp 0 int k = Integer.parseInt(temp[1]); k Integer.parseInt(temp[1]) Integer.parseInt Integer temp[1] temp 1 String[] temp2  = scanner.nextLine().split(" "); temp2 scanner.nextLine().split(" ") scanner.nextLine().split scanner.nextLine() scanner.nextLine scanner " " Long[] mlist     = new Long[n]; mlist new Long[n] n for(int i = 0; i < n; i++) {

			mlist[i] = Long.parseLong(temp2[i]);

		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {

			mlist[i] = Long.parseLong(temp2[i]);

		} {

			mlist[i] = Long.parseLong(temp2[i]);

		} mlist[i] = Long.parseLong(temp2[i]) mlist[i] mlist i Long.parseLong(temp2[i]) Long.parseLong Long temp2[i] temp2 i Arrays.sort(mlist,Collections.reverseOrder()) Arrays.sort Arrays mlist Collections.reverseOrder() Collections.reverseOrder Collections long sum = 0; sum 0 for(int i = 0; i < n; i++) {

			if(i >= k) {

				sum += mlist[i];

			}


		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {

			if(i >= k) {

				sum += mlist[i];

			}


		} {

			if(i >= k) {

				sum += mlist[i];

			}


		} if(i >= k) {

				sum += mlist[i];

			} i >= k i k {

				sum += mlist[i];

			} sum += mlist[i] sum mlist[i] mlist i System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main{

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		String[] temp   = scanner.nextLine().split(" ");
		int n = Integer.parseInt(temp[0]);
		int k = Integer.parseInt(temp[1]);
		String[] temp2  = scanner.nextLine().split(" ");
		Long[] mlist     = new Long[n];

		for(int i = 0; i < n; i++) {

			mlist[i] = Long.parseLong(temp2[i]);

		}

		Arrays.sort(mlist,Collections.reverseOrder());
		long sum = 0;

		for(int i = 0; i < n; i++) {

			if(i >= k) {

				sum += mlist[i];

			}


		}

		System.out.println(sum);

	}

} public class Main{

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		String[] temp   = scanner.nextLine().split(" ");
		int n = Integer.parseInt(temp[0]);
		int k = Integer.parseInt(temp[1]);
		String[] temp2  = scanner.nextLine().split(" ");
		Long[] mlist     = new Long[n];

		for(int i = 0; i < n; i++) {

			mlist[i] = Long.parseLong(temp2[i]);

		}

		Arrays.sort(mlist,Collections.reverseOrder());
		long sum = 0;

		for(int i = 0; i < n; i++) {

			if(i >= k) {

				sum += mlist[i];

			}


		}

		System.out.println(sum);

	}

} Main
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		String[] temp   = scanner.nextLine().split(" ");
		int n = Integer.parseInt(temp[0]);
		int k = Integer.parseInt(temp[1]);
		String[] temp2  = scanner.nextLine().split(" ");
		Long[] mlist     = new Long[n];

		for(int i = 0; i < n; i++) {

			mlist[i] = Long.parseLong(temp2[i]);

		}

		Arrays.sort(mlist,Collections.reverseOrder());
		long sum = 0;

		for(int i = 0; i < n; i++) {

			if(i >= k) {

				sum += mlist[i];

			}


		}

		System.out.println(sum);

	}

}