import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int count = scan.nextInt();
		
		List<Integer> hpList = new ArrayList<Integer>();
		for (int i=0; i<n; i++) {
			hpList.add(scan.nextInt());
		}
		Collections.sort(hpList);
		
		long minAttackCount = 0;
		for (int i=0; i<hpList.size()-count; i++) {
			minAttackCount += hpList.get(i);
		}
		
		System.out.println(minAttackCount);
	}
	
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.List; List 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 count = scan.nextInt();
		
		List<Integer> hpList = new ArrayList<Integer>();
		for (int i=0; i<n; i++) {
			hpList.add(scan.nextInt());
		}
		Collections.sort(hpList);
		
		long minAttackCount = 0;
		for (int i=0; i<hpList.size()-count; i++) {
			minAttackCount += hpList.get(i);
		}
		
		System.out.println(minAttackCount);
	}
	
} Main public static void main(String[] args) {
		
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int count = scan.nextInt();
		
		List<Integer> hpList = new ArrayList<Integer>();
		for (int i=0; i<n; i++) {
			hpList.add(scan.nextInt());
		}
		Collections.sort(hpList);
		
		long minAttackCount = 0;
		for (int i=0; i<hpList.size()-count; i++) {
			minAttackCount += hpList.get(i);
		}
		
		System.out.println(minAttackCount);
	} main {
		
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int count = scan.nextInt();
		
		List<Integer> hpList = new ArrayList<Integer>();
		for (int i=0; i<n; i++) {
			hpList.add(scan.nextInt());
		}
		Collections.sort(hpList);
		
		long minAttackCount = 0;
		for (int i=0; i<hpList.size()-count; i++) {
			minAttackCount += hpList.get(i);
		}
		
		System.out.println(minAttackCount);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int count = scan.nextInt(); count scan.nextInt() scan.nextInt scan List<Integer> hpList = new ArrayList<Integer>(); hpList new ArrayList<Integer>() for (int i=0; i<n; i++) {
			hpList.add(scan.nextInt());
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			hpList.add(scan.nextInt());
		} {
			hpList.add(scan.nextInt());
		} hpList.add(scan.nextInt()) hpList.add hpList scan.nextInt() scan.nextInt scan Collections.sort(hpList) Collections.sort Collections hpList long minAttackCount = 0; minAttackCount 0 for (int i=0; i<hpList.size()-count; i++) {
			minAttackCount += hpList.get(i);
		} int i=0; int i=0; i 0 i<hpList.size()-count i hpList.size()-count hpList.size() hpList.size hpList count i++ i++ i {
			minAttackCount += hpList.get(i);
		} {
			minAttackCount += hpList.get(i);
		} minAttackCount += hpList.get(i) minAttackCount hpList.get(i) hpList.get hpList i System.out.println(minAttackCount) System.out.println System.out System System.out minAttackCount String[] args args public class Main {

	public static void main(String[] args) {
		
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int count = scan.nextInt();
		
		List<Integer> hpList = new ArrayList<Integer>();
		for (int i=0; i<n; i++) {
			hpList.add(scan.nextInt());
		}
		Collections.sort(hpList);
		
		long minAttackCount = 0;
		for (int i=0; i<hpList.size()-count; i++) {
			minAttackCount += hpList.get(i);
		}
		
		System.out.println(minAttackCount);
	}
	
} public class Main {

	public static void main(String[] args) {
		
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int count = scan.nextInt();
		
		List<Integer> hpList = new ArrayList<Integer>();
		for (int i=0; i<n; i++) {
			hpList.add(scan.nextInt());
		}
		Collections.sort(hpList);
		
		long minAttackCount = 0;
		for (int i=0; i<hpList.size()-count; i++) {
			minAttackCount += hpList.get(i);
		}
		
		System.out.println(minAttackCount);
	}
	
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int count = scan.nextInt();
		
		List<Integer> hpList = new ArrayList<Integer>();
		for (int i=0; i<n; i++) {
			hpList.add(scan.nextInt());
		}
		Collections.sort(hpList);
		
		long minAttackCount = 0;
		for (int i=0; i<hpList.size()-count; i++) {
			minAttackCount += hpList.get(i);
		}
		
		System.out.println(minAttackCount);
	}
	
}