import java.util.ArrayList;
import java.util.Collections;
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 sum = 0;
		
		ArrayList<Long> h = new ArrayList<Long>();
		
		for(int i = 0; i < n; i++){
			h.add(scan.nextLong()); 
		}
		
		Collections.sort(h,Collections.reverseOrder());
		
		for(int i = k; i < n; i++){
			sum += h.get(i);
		}
		
		System.out.println(sum);
		
	}
} import java.util.ArrayList; ArrayList 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 scan = new Scanner(System.in);

		int n = scan.nextInt();
		int k = scan.nextInt();
		long sum = 0;
		
		ArrayList<Long> h = new ArrayList<Long>();
		
		for(int i = 0; i < n; i++){
			h.add(scan.nextLong()); 
		}
		
		Collections.sort(h,Collections.reverseOrder());
		
		for(int i = k; i < n; i++){
			sum += h.get(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 sum = 0;
		
		ArrayList<Long> h = new ArrayList<Long>();
		
		for(int i = 0; i < n; i++){
			h.add(scan.nextLong()); 
		}
		
		Collections.sort(h,Collections.reverseOrder());
		
		for(int i = k; i < n; i++){
			sum += h.get(i);
		}
		
		System.out.println(sum);
		
	} main {

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int k = scan.nextInt();
		long sum = 0;
		
		ArrayList<Long> h = new ArrayList<Long>();
		
		for(int i = 0; i < n; i++){
			h.add(scan.nextLong()); 
		}
		
		Collections.sort(h,Collections.reverseOrder());
		
		for(int i = k; i < n; i++){
			sum += h.get(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 sum = 0; sum 0 ArrayList<Long> h = new ArrayList<Long>(); h new ArrayList<Long>() for(int i = 0; i < n; i++){
			h.add(scan.nextLong()); 
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			h.add(scan.nextLong()); 
		} {
			h.add(scan.nextLong()); 
		} h.add(scan.nextLong()) h.add h scan.nextLong() scan.nextLong scan Collections.sort(h,Collections.reverseOrder()) Collections.sort Collections h Collections.reverseOrder() Collections.reverseOrder Collections for(int i = k; i < n; i++){
			sum += h.get(i);
		} int i = k; int i = k; i k i < n i n i++ i++ i {
			sum += h.get(i);
		} {
			sum += h.get(i);
		} sum += h.get(i) sum h.get(i) h.get h 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 sum = 0;
		
		ArrayList<Long> h = new ArrayList<Long>();
		
		for(int i = 0; i < n; i++){
			h.add(scan.nextLong()); 
		}
		
		Collections.sort(h,Collections.reverseOrder());
		
		for(int i = k; i < n; i++){
			sum += h.get(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 sum = 0;
		
		ArrayList<Long> h = new ArrayList<Long>();
		
		for(int i = 0; i < n; i++){
			h.add(scan.nextLong()); 
		}
		
		Collections.sort(h,Collections.reverseOrder());
		
		for(int i = k; i < n; i++){
			sum += h.get(i);
		}
		
		System.out.println(sum);
		
	}
} Main
import java.util.ArrayList;
import java.util.Collections;
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 sum = 0;
		
		ArrayList<Long> h = new ArrayList<Long>();
		
		for(int i = 0; i < n; i++){
			h.add(scan.nextLong()); 
		}
		
		Collections.sort(h,Collections.reverseOrder());
		
		for(int i = k; i < n; i++){
			sum += h.get(i);
		}
		
		System.out.println(sum);
		
	}
}