import java.util.Arrays;
import java.util.Scanner;
 
public class Main {
	public static void main (String[] args) {
      Scanner scan = new Scanner(System.in);
      int n = scan.nextInt();
		int k = scan.nextInt();
		long[] nums = new long[n];
		
		for (int i = 0; i < n; i++) {
			nums[i] = scan.nextInt();
		}
		
		Arrays.sort(nums);
		long sum = 0;
		for (int i = 0; i < nums.length - k; i++) {
			sum+= nums[i];
		}
		
		System.out.println(sum);

	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main (String[] args) {
      Scanner scan = new Scanner(System.in);
      int n = scan.nextInt();
		int k = scan.nextInt();
		long[] nums = new long[n];
		
		for (int i = 0; i < n; i++) {
			nums[i] = scan.nextInt();
		}
		
		Arrays.sort(nums);
		long sum = 0;
		for (int i = 0; i < nums.length - k; i++) {
			sum+= nums[i];
		}
		
		System.out.println(sum);

	}
} Main public static void main (String[] args) {
      Scanner scan = new Scanner(System.in);
      int n = scan.nextInt();
		int k = scan.nextInt();
		long[] nums = new long[n];
		
		for (int i = 0; i < n; i++) {
			nums[i] = scan.nextInt();
		}
		
		Arrays.sort(nums);
		long sum = 0;
		for (int i = 0; i < nums.length - k; i++) {
			sum+= nums[i];
		}
		
		System.out.println(sum);

	} main {
      Scanner scan = new Scanner(System.in);
      int n = scan.nextInt();
		int k = scan.nextInt();
		long[] nums = new long[n];
		
		for (int i = 0; i < n; i++) {
			nums[i] = scan.nextInt();
		}
		
		Arrays.sort(nums);
		long sum = 0;
		for (int i = 0; i < nums.length - k; i++) {
			sum+= nums[i];
		}
		
		System.out.println(sum);

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int k = scan.nextInt(); k scan.nextInt() scan.nextInt scan long[] nums = new long[n]; nums new long[n] n for (int i = 0; i < n; i++) {
			nums[i] = scan.nextInt();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			nums[i] = scan.nextInt();
		} {
			nums[i] = scan.nextInt();
		} nums[i] = scan.nextInt() nums[i] nums i scan.nextInt() scan.nextInt scan Arrays.sort(nums) Arrays.sort Arrays nums long sum = 0; sum 0 for (int i = 0; i < nums.length - k; i++) {
			sum+= nums[i];
		} int i = 0; int i = 0; i 0 i < nums.length - k i nums.length - k nums.length nums nums.length k i++ i++ i {
			sum+= nums[i];
		} {
			sum+= nums[i];
		} sum+= nums[i] sum nums[i] nums 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 scan = new Scanner(System.in);
      int n = scan.nextInt();
		int k = scan.nextInt();
		long[] nums = new long[n];
		
		for (int i = 0; i < n; i++) {
			nums[i] = scan.nextInt();
		}
		
		Arrays.sort(nums);
		long sum = 0;
		for (int i = 0; i < nums.length - k; i++) {
			sum+= nums[i];
		}
		
		System.out.println(sum);

	}
} public class Main {
	public static void main (String[] args) {
      Scanner scan = new Scanner(System.in);
      int n = scan.nextInt();
		int k = scan.nextInt();
		long[] nums = new long[n];
		
		for (int i = 0; i < n; i++) {
			nums[i] = scan.nextInt();
		}
		
		Arrays.sort(nums);
		long sum = 0;
		for (int i = 0; i < nums.length - k; i++) {
			sum+= nums[i];
		}
		
		System.out.println(sum);

	}
} Main
import java.util.Arrays;
import java.util.Scanner;
 
public class Main {
	public static void main (String[] args) {
      Scanner scan = new Scanner(System.in);
      int n = scan.nextInt();
		int k = scan.nextInt();
		long[] nums = new long[n];
		
		for (int i = 0; i < n; i++) {
			nums[i] = scan.nextInt();
		}
		
		Arrays.sort(nums);
		long sum = 0;
		for (int i = 0; i < nums.length - k; i++) {
			sum+= nums[i];
		}
		
		System.out.println(sum);

	}
}