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 K = scan.nextInt();

		List<Long> list = new ArrayList<>();

		for(int i = 0; i < N; i++) {
			list.add(scan.nextLong());
		}

		// 降順ソート
		Collections.sort(list, Collections.reverseOrder());

		if(N < K) {
			System.out.println(0);
			return;
		}

		long ans = 0l;

		for(int i = K; i < N; i++) {
			ans += list.get(i);
			//System.out.println(ans);

		}

		System.out.println(ans);
	}
} 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 K = scan.nextInt();

		List<Long> list = new ArrayList<>();

		for(int i = 0; i < N; i++) {
			list.add(scan.nextLong());
		}

		// 降順ソート
		Collections.sort(list, Collections.reverseOrder());

		if(N < K) {
			System.out.println(0);
			return;
		}

		long ans = 0l;

		for(int i = K; i < N; i++) {
			ans += list.get(i);
			//System.out.println(ans);

		}

		System.out.println(ans);
	}
} Main public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int N = scan.nextInt();
		int K = scan.nextInt();

		List<Long> list = new ArrayList<>();

		for(int i = 0; i < N; i++) {
			list.add(scan.nextLong());
		}

		// 降順ソート
		Collections.sort(list, Collections.reverseOrder());

		if(N < K) {
			System.out.println(0);
			return;
		}

		long ans = 0l;

		for(int i = K; i < N; i++) {
			ans += list.get(i);
			//System.out.println(ans);

		}

		System.out.println(ans);
	} main {

		Scanner scan = new Scanner(System.in);

		int N = scan.nextInt();
		int K = scan.nextInt();

		List<Long> list = new ArrayList<>();

		for(int i = 0; i < N; i++) {
			list.add(scan.nextLong());
		}

		// 降順ソート
		Collections.sort(list, Collections.reverseOrder());

		if(N < K) {
			System.out.println(0);
			return;
		}

		long ans = 0l;

		for(int i = K; i < N; i++) {
			ans += list.get(i);
			//System.out.println(ans);

		}

		System.out.println(ans);
	} 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 List<Long> list = new ArrayList<>(); list new ArrayList<>() for(int i = 0; i < N; i++) {
			list.add(scan.nextLong());
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			list.add(scan.nextLong());
		} {
			list.add(scan.nextLong());
		} list.add(scan.nextLong()) list.add list scan.nextLong() scan.nextLong scan Collections.sort(list, Collections.reverseOrder()) Collections.sort Collections list Collections.reverseOrder() Collections.reverseOrder Collections if(N < K) {
			System.out.println(0);
			return;
		} N < K N K {
			System.out.println(0);
			return;
		} System.out.println(0) System.out.println System.out System System.out 0 return; long ans = 0l; ans 0l for(int i = K; i < N; i++) {
			ans += list.get(i);
			//System.out.println(ans);

		} int i = K; int i = K; i K i < N i N i++ i++ i {
			ans += list.get(i);
			//System.out.println(ans);

		} {
			ans += list.get(i);
			//System.out.println(ans);

		} ans += list.get(i) ans list.get(i) list.get list i System.out.println(ans) System.out.println System.out System System.out ans 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();

		List<Long> list = new ArrayList<>();

		for(int i = 0; i < N; i++) {
			list.add(scan.nextLong());
		}

		// 降順ソート
		Collections.sort(list, Collections.reverseOrder());

		if(N < K) {
			System.out.println(0);
			return;
		}

		long ans = 0l;

		for(int i = K; i < N; i++) {
			ans += list.get(i);
			//System.out.println(ans);

		}

		System.out.println(ans);
	}
} public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int N = scan.nextInt();
		int K = scan.nextInt();

		List<Long> list = new ArrayList<>();

		for(int i = 0; i < N; i++) {
			list.add(scan.nextLong());
		}

		// 降順ソート
		Collections.sort(list, Collections.reverseOrder());

		if(N < K) {
			System.out.println(0);
			return;
		}

		long ans = 0l;

		for(int i = K; i < N; i++) {
			ans += list.get(i);
			//System.out.println(ans);

		}

		System.out.println(ans);
	}
} 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 K = scan.nextInt();

		List<Long> list = new ArrayList<>();

		for(int i = 0; i < N; i++) {
			list.add(scan.nextLong());
		}

		// 降順ソート
		Collections.sort(list, Collections.reverseOrder());

		if(N < K) {
			System.out.println(0);
			return;
		}

		long ans = 0l;

		for(int i = K; i < N; i++) {
			ans += list.get(i);
			//System.out.println(ans);

		}

		System.out.println(ans);
	}
}