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

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int n = kb.nextInt();
		int k = kb.nextInt();
		ArrayList<Long> h = new ArrayList<>();
		long sum = 0;
		for (int i = 0; i < n; i++) {
			long j = kb.nextLong();
			h.add(j);
		}
		Collections.sort(h);
		int count = 0;
		for (long e : h) {
			count += 1;
		}
		// System.out.println(count);
		for (long i = 0; i < k; i++) {
			h.remove(count - 1);
			count -= 1;
			if (count == 0)
				break;
		}
		// System.out.println(h);
		for (long e : h) {
			sum += e;
			//System.out.println(sum);
		}
		System.out.println(sum);

		kb.close();
	}

} 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) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int n = kb.nextInt();
		int k = kb.nextInt();
		ArrayList<Long> h = new ArrayList<>();
		long sum = 0;
		for (int i = 0; i < n; i++) {
			long j = kb.nextLong();
			h.add(j);
		}
		Collections.sort(h);
		int count = 0;
		for (long e : h) {
			count += 1;
		}
		// System.out.println(count);
		for (long i = 0; i < k; i++) {
			h.remove(count - 1);
			count -= 1;
			if (count == 0)
				break;
		}
		// System.out.println(h);
		for (long e : h) {
			sum += e;
			//System.out.println(sum);
		}
		System.out.println(sum);

		kb.close();
	}

} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int n = kb.nextInt();
		int k = kb.nextInt();
		ArrayList<Long> h = new ArrayList<>();
		long sum = 0;
		for (int i = 0; i < n; i++) {
			long j = kb.nextLong();
			h.add(j);
		}
		Collections.sort(h);
		int count = 0;
		for (long e : h) {
			count += 1;
		}
		// System.out.println(count);
		for (long i = 0; i < k; i++) {
			h.remove(count - 1);
			count -= 1;
			if (count == 0)
				break;
		}
		// System.out.println(h);
		for (long e : h) {
			sum += e;
			//System.out.println(sum);
		}
		System.out.println(sum);

		kb.close();
	} main {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int n = kb.nextInt();
		int k = kb.nextInt();
		ArrayList<Long> h = new ArrayList<>();
		long sum = 0;
		for (int i = 0; i < n; i++) {
			long j = kb.nextLong();
			h.add(j);
		}
		Collections.sort(h);
		int count = 0;
		for (long e : h) {
			count += 1;
		}
		// System.out.println(count);
		for (long i = 0; i < k; i++) {
			h.remove(count - 1);
			count -= 1;
			if (count == 0)
				break;
		}
		// System.out.println(h);
		for (long e : h) {
			sum += e;
			//System.out.println(sum);
		}
		System.out.println(sum);

		kb.close();
	} Scanner kb = new Scanner(System.in); kb new Scanner(System.in) int n = kb.nextInt(); n kb.nextInt() kb.nextInt kb int k = kb.nextInt(); k kb.nextInt() kb.nextInt kb ArrayList<Long> h = new ArrayList<>(); h new ArrayList<>() long sum = 0; sum 0 for (int i = 0; i < n; i++) {
			long j = kb.nextLong();
			h.add(j);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			long j = kb.nextLong();
			h.add(j);
		} {
			long j = kb.nextLong();
			h.add(j);
		} long j = kb.nextLong(); j kb.nextLong() kb.nextLong kb h.add(j) h.add h j Collections.sort(h) Collections.sort Collections h int count = 0; count 0 for (long e : h) {
			count += 1;
		} long e h {
			count += 1;
		} {
			count += 1;
		} count += 1 count 1 for (long i = 0; i < k; i++) {
			h.remove(count - 1);
			count -= 1;
			if (count == 0)
				break;
		} long i = 0; long i = 0; i 0 i < k i k i++ i++ i {
			h.remove(count - 1);
			count -= 1;
			if (count == 0)
				break;
		} {
			h.remove(count - 1);
			count -= 1;
			if (count == 0)
				break;
		} h.remove(count - 1) h.remove h count - 1 count 1 count -= 1 count 1 if (count == 0)
				break; count == 0 count 0 break; for (long e : h) {
			sum += e;
			//System.out.println(sum);
		} long e h {
			sum += e;
			//System.out.println(sum);
		} {
			sum += e;
			//System.out.println(sum);
		} sum += e sum e System.out.println(sum) System.out.println System.out System System.out sum kb.close() kb.close kb String[] args args public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int n = kb.nextInt();
		int k = kb.nextInt();
		ArrayList<Long> h = new ArrayList<>();
		long sum = 0;
		for (int i = 0; i < n; i++) {
			long j = kb.nextLong();
			h.add(j);
		}
		Collections.sort(h);
		int count = 0;
		for (long e : h) {
			count += 1;
		}
		// System.out.println(count);
		for (long i = 0; i < k; i++) {
			h.remove(count - 1);
			count -= 1;
			if (count == 0)
				break;
		}
		// System.out.println(h);
		for (long e : h) {
			sum += e;
			//System.out.println(sum);
		}
		System.out.println(sum);

		kb.close();
	}

} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int n = kb.nextInt();
		int k = kb.nextInt();
		ArrayList<Long> h = new ArrayList<>();
		long sum = 0;
		for (int i = 0; i < n; i++) {
			long j = kb.nextLong();
			h.add(j);
		}
		Collections.sort(h);
		int count = 0;
		for (long e : h) {
			count += 1;
		}
		// System.out.println(count);
		for (long i = 0; i < k; i++) {
			h.remove(count - 1);
			count -= 1;
			if (count == 0)
				break;
		}
		// System.out.println(h);
		for (long e : h) {
			sum += e;
			//System.out.println(sum);
		}
		System.out.println(sum);

		kb.close();
	}

} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int n = kb.nextInt();
		int k = kb.nextInt();
		ArrayList<Long> h = new ArrayList<>();
		long sum = 0;
		for (int i = 0; i < n; i++) {
			long j = kb.nextLong();
			h.add(j);
		}
		Collections.sort(h);
		int count = 0;
		for (long e : h) {
			count += 1;
		}
		// System.out.println(count);
		for (long i = 0; i < k; i++) {
			h.remove(count - 1);
			count -= 1;
			if (count == 0)
				break;
		}
		// System.out.println(h);
		for (long e : h) {
			sum += e;
			//System.out.println(sum);
		}
		System.out.println(sum);

		kb.close();
	}

}
