import java.util.ArrayList;
import java.util.Comparator;
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();
		ArrayList<Integer> lifeList = new ArrayList<>();
		long ans = 0;
		
		for(int i = 0; i < N; i++) {
			lifeList.add(sc.nextInt());
		}

		lifeList.sort(Comparator.reverseOrder());
		int attackTimes = Math.min(K, N); 
		
		for(int i = attackTimes; i < lifeList.size(); i++) {
			ans += lifeList.get(i);
		}

		System.out.println(ans);
		sc.close();
	}
	
} import java.util.ArrayList; ArrayList java.util import java.util.Comparator; Comparator 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();
		ArrayList<Integer> lifeList = new ArrayList<>();
		long ans = 0;
		
		for(int i = 0; i < N; i++) {
			lifeList.add(sc.nextInt());
		}

		lifeList.sort(Comparator.reverseOrder());
		int attackTimes = Math.min(K, N); 
		
		for(int i = attackTimes; i < lifeList.size(); i++) {
			ans += lifeList.get(i);
		}

		System.out.println(ans);
		sc.close();
	}
	
} Main public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		ArrayList<Integer> lifeList = new ArrayList<>();
		long ans = 0;
		
		for(int i = 0; i < N; i++) {
			lifeList.add(sc.nextInt());
		}

		lifeList.sort(Comparator.reverseOrder());
		int attackTimes = Math.min(K, N); 
		
		for(int i = attackTimes; i < lifeList.size(); i++) {
			ans += lifeList.get(i);
		}

		System.out.println(ans);
		sc.close();
	} main {
		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		ArrayList<Integer> lifeList = new ArrayList<>();
		long ans = 0;
		
		for(int i = 0; i < N; i++) {
			lifeList.add(sc.nextInt());
		}

		lifeList.sort(Comparator.reverseOrder());
		int attackTimes = Math.min(K, N); 
		
		for(int i = attackTimes; i < lifeList.size(); i++) {
			ans += lifeList.get(i);
		}

		System.out.println(ans);
		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 ArrayList<Integer> lifeList = new ArrayList<>(); lifeList new ArrayList<>() long ans = 0; ans 0 for(int i = 0; i < N; i++) {
			lifeList.add(sc.nextInt());
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			lifeList.add(sc.nextInt());
		} {
			lifeList.add(sc.nextInt());
		} lifeList.add(sc.nextInt()) lifeList.add lifeList sc.nextInt() sc.nextInt sc lifeList.sort(Comparator.reverseOrder()) lifeList.sort lifeList Comparator.reverseOrder() Comparator.reverseOrder Comparator int attackTimes = Math.min(K, N); attackTimes Math.min(K, N) Math.min Math K N for(int i = attackTimes; i < lifeList.size(); i++) {
			ans += lifeList.get(i);
		} int i = attackTimes; int i = attackTimes; i attackTimes i < lifeList.size() i lifeList.size() lifeList.size lifeList i++ i++ i {
			ans += lifeList.get(i);
		} {
			ans += lifeList.get(i);
		} ans += lifeList.get(i) ans lifeList.get(i) lifeList.get lifeList i System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc String[] args args public class Main {
 
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		ArrayList<Integer> lifeList = new ArrayList<>();
		long ans = 0;
		
		for(int i = 0; i < N; i++) {
			lifeList.add(sc.nextInt());
		}

		lifeList.sort(Comparator.reverseOrder());
		int attackTimes = Math.min(K, N); 
		
		for(int i = attackTimes; i < lifeList.size(); i++) {
			ans += lifeList.get(i);
		}

		System.out.println(ans);
		sc.close();
	}
	
} public class Main {
 
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		ArrayList<Integer> lifeList = new ArrayList<>();
		long ans = 0;
		
		for(int i = 0; i < N; i++) {
			lifeList.add(sc.nextInt());
		}

		lifeList.sort(Comparator.reverseOrder());
		int attackTimes = Math.min(K, N); 
		
		for(int i = attackTimes; i < lifeList.size(); i++) {
			ans += lifeList.get(i);
		}

		System.out.println(ans);
		sc.close();
	}
	
} Main
import java.util.ArrayList;
import java.util.Comparator;
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();
		ArrayList<Integer> lifeList = new ArrayList<>();
		long ans = 0;
		
		for(int i = 0; i < N; i++) {
			lifeList.add(sc.nextInt());
		}

		lifeList.sort(Comparator.reverseOrder());
		int attackTimes = Math.min(K, N); 
		
		for(int i = attackTimes; i < lifeList.size(); i++) {
			ans += lifeList.get(i);
		}

		System.out.println(ans);
		sc.close();
	}
	
}