import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;

public class Main {

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

	public static long solve() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		Queue<Integer> q = new PriorityQueue<Integer>();
		for (int i = 0; i < N; i++) {
			q.add(sc.nextInt());
		}

		int[] t = new int[N];
		for (int j = q.size() - 1; j >= 0; --j) {
			t[j] = q.poll();
		}

		long sum = 0;
		if (K <= N)
			for (int l = K; l < t.length; l++) {
				sum += t[l];
			}
		return sum;
	}
}
	 import java.util.PriorityQueue; PriorityQueue java.util import java.util.Queue; Queue java.util import java.util.Scanner; Scanner java.util public class Main {

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

	public static long solve() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		Queue<Integer> q = new PriorityQueue<Integer>();
		for (int i = 0; i < N; i++) {
			q.add(sc.nextInt());
		}

		int[] t = new int[N];
		for (int j = q.size() - 1; j >= 0; --j) {
			t[j] = q.poll();
		}

		long sum = 0;
		if (K <= N)
			for (int l = K; l < t.length; l++) {
				sum += t[l];
			}
		return sum;
	}
} Main public static void main(String[] args) {
		System.out.println(solve());
	} main {
		System.out.println(solve());
	} System.out.println(solve()) System.out.println System.out System System.out solve() solve String[] args args public static long solve() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		Queue<Integer> q = new PriorityQueue<Integer>();
		for (int i = 0; i < N; i++) {
			q.add(sc.nextInt());
		}

		int[] t = new int[N];
		for (int j = q.size() - 1; j >= 0; --j) {
			t[j] = q.poll();
		}

		long sum = 0;
		if (K <= N)
			for (int l = K; l < t.length; l++) {
				sum += t[l];
			}
		return sum;
	} solve {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		Queue<Integer> q = new PriorityQueue<Integer>();
		for (int i = 0; i < N; i++) {
			q.add(sc.nextInt());
		}

		int[] t = new int[N];
		for (int j = q.size() - 1; j >= 0; --j) {
			t[j] = q.poll();
		}

		long sum = 0;
		if (K <= N)
			for (int l = K; l < t.length; l++) {
				sum += t[l];
			}
		return sum;
	} 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 Queue<Integer> q = new PriorityQueue<Integer>(); q new PriorityQueue<Integer>() for (int i = 0; i < N; i++) {
			q.add(sc.nextInt());
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			q.add(sc.nextInt());
		} {
			q.add(sc.nextInt());
		} q.add(sc.nextInt()) q.add q sc.nextInt() sc.nextInt sc int[] t = new int[N]; t new int[N] N for (int j = q.size() - 1; j >= 0; --j) {
			t[j] = q.poll();
		} int j = q.size() - 1; int j = q.size() - 1; j q.size() - 1 q.size() q.size q 1 j >= 0 j 0 --j --j j {
			t[j] = q.poll();
		} {
			t[j] = q.poll();
		} t[j] = q.poll() t[j] t j q.poll() q.poll q long sum = 0; sum 0 if (K <= N)
			for (int l = K; l < t.length; l++) {
				sum += t[l];
			} K <= N K N for (int l = K; l < t.length; l++) {
				sum += t[l];
			} int l = K; int l = K; l K l < t.length l t.length t t.length l++ l++ l {
				sum += t[l];
			} {
				sum += t[l];
			} sum += t[l] sum t[l] t l return sum; sum public class Main {

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

	public static long solve() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		Queue<Integer> q = new PriorityQueue<Integer>();
		for (int i = 0; i < N; i++) {
			q.add(sc.nextInt());
		}

		int[] t = new int[N];
		for (int j = q.size() - 1; j >= 0; --j) {
			t[j] = q.poll();
		}

		long sum = 0;
		if (K <= N)
			for (int l = K; l < t.length; l++) {
				sum += t[l];
			}
		return sum;
	}
} public class Main {

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

	public static long solve() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		Queue<Integer> q = new PriorityQueue<Integer>();
		for (int i = 0; i < N; i++) {
			q.add(sc.nextInt());
		}

		int[] t = new int[N];
		for (int j = q.size() - 1; j >= 0; --j) {
			t[j] = q.poll();
		}

		long sum = 0;
		if (K <= N)
			for (int l = K; l < t.length; l++) {
				sum += t[l];
			}
		return sum;
	}
} Main
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;

public class Main {

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

	public static long solve() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		Queue<Integer> q = new PriorityQueue<Integer>();
		for (int i = 0; i < N; i++) {
			q.add(sc.nextInt());
		}

		int[] t = new int[N];
		for (int j = q.size() - 1; j >= 0; --j) {
			t[j] = q.poll();
		}

		long sum = 0;
		if (K <= N)
			for (int l = K; l < t.length; l++) {
				sum += t[l];
			}
		return sum;
	}
}
	