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

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String l1 = scan.nextLine();
		String l2 = scan.nextLine();
		scan.close();

		long n = Long.valueOf(l1.split(" ")[0]);
		long k = Long.valueOf(l1.split(" ")[1]);
		String strH = l2;
		List<Long> h = new ArrayList<Long>();
		for (String element : strH.split(" ")) {
			h.add(Long.valueOf(element));
		}

		Collections.sort(h, Collections.reverseOrder());

		Map<Integer, Long> hMap = new HashMap<>();
		int li = 0;
		for (Long element : h) {
			hMap.put(li, element);
			li++;
		}

		for (int i = 0; i < k; i++) {
			hMap.put(i, Long.valueOf(0));
		}

		long result = 0;
		for (Long element : hMap.values()) {
			result += element;
		}

		System.out.println(result);
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.HashMap; HashMap java.util import java.util.List; List java.util import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String l1 = scan.nextLine();
		String l2 = scan.nextLine();
		scan.close();

		long n = Long.valueOf(l1.split(" ")[0]);
		long k = Long.valueOf(l1.split(" ")[1]);
		String strH = l2;
		List<Long> h = new ArrayList<Long>();
		for (String element : strH.split(" ")) {
			h.add(Long.valueOf(element));
		}

		Collections.sort(h, Collections.reverseOrder());

		Map<Integer, Long> hMap = new HashMap<>();
		int li = 0;
		for (Long element : h) {
			hMap.put(li, element);
			li++;
		}

		for (int i = 0; i < k; i++) {
			hMap.put(i, Long.valueOf(0));
		}

		long result = 0;
		for (Long element : hMap.values()) {
			result += element;
		}

		System.out.println(result);
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String l1 = scan.nextLine();
		String l2 = scan.nextLine();
		scan.close();

		long n = Long.valueOf(l1.split(" ")[0]);
		long k = Long.valueOf(l1.split(" ")[1]);
		String strH = l2;
		List<Long> h = new ArrayList<Long>();
		for (String element : strH.split(" ")) {
			h.add(Long.valueOf(element));
		}

		Collections.sort(h, Collections.reverseOrder());

		Map<Integer, Long> hMap = new HashMap<>();
		int li = 0;
		for (Long element : h) {
			hMap.put(li, element);
			li++;
		}

		for (int i = 0; i < k; i++) {
			hMap.put(i, Long.valueOf(0));
		}

		long result = 0;
		for (Long element : hMap.values()) {
			result += element;
		}

		System.out.println(result);
	} main {
		Scanner scan = new Scanner(System.in);
		String l1 = scan.nextLine();
		String l2 = scan.nextLine();
		scan.close();

		long n = Long.valueOf(l1.split(" ")[0]);
		long k = Long.valueOf(l1.split(" ")[1]);
		String strH = l2;
		List<Long> h = new ArrayList<Long>();
		for (String element : strH.split(" ")) {
			h.add(Long.valueOf(element));
		}

		Collections.sort(h, Collections.reverseOrder());

		Map<Integer, Long> hMap = new HashMap<>();
		int li = 0;
		for (Long element : h) {
			hMap.put(li, element);
			li++;
		}

		for (int i = 0; i < k; i++) {
			hMap.put(i, Long.valueOf(0));
		}

		long result = 0;
		for (Long element : hMap.values()) {
			result += element;
		}

		System.out.println(result);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String l1 = scan.nextLine(); l1 scan.nextLine() scan.nextLine scan String l2 = scan.nextLine(); l2 scan.nextLine() scan.nextLine scan scan.close() scan.close scan long n = Long.valueOf(l1.split(" ")[0]); n Long.valueOf(l1.split(" ")[0]) Long.valueOf Long l1.split(" ")[0] l1.split(" ") l1.split l1 " " 0 long k = Long.valueOf(l1.split(" ")[1]); k Long.valueOf(l1.split(" ")[1]) Long.valueOf Long l1.split(" ")[1] l1.split(" ") l1.split l1 " " 1 String strH = l2; strH l2 List<Long> h = new ArrayList<Long>(); h new ArrayList<Long>() for (String element : strH.split(" ")) {
			h.add(Long.valueOf(element));
		} String element strH.split(" ") strH.split strH " " {
			h.add(Long.valueOf(element));
		} {
			h.add(Long.valueOf(element));
		} h.add(Long.valueOf(element)) h.add h Long.valueOf(element) Long.valueOf Long element Collections.sort(h, Collections.reverseOrder()) Collections.sort Collections h Collections.reverseOrder() Collections.reverseOrder Collections Map<Integer, Long> hMap = new HashMap<>(); hMap new HashMap<>() int li = 0; li 0 for (Long element : h) {
			hMap.put(li, element);
			li++;
		} Long element h {
			hMap.put(li, element);
			li++;
		} {
			hMap.put(li, element);
			li++;
		} hMap.put(li, element) hMap.put hMap li element li++ li for (int i = 0; i < k; i++) {
			hMap.put(i, Long.valueOf(0));
		} int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
			hMap.put(i, Long.valueOf(0));
		} {
			hMap.put(i, Long.valueOf(0));
		} hMap.put(i, Long.valueOf(0)) hMap.put hMap i Long.valueOf(0) Long.valueOf Long 0 long result = 0; result 0 for (Long element : hMap.values()) {
			result += element;
		} Long element hMap.values() hMap.values hMap {
			result += element;
		} {
			result += element;
		} result += element result element System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String l1 = scan.nextLine();
		String l2 = scan.nextLine();
		scan.close();

		long n = Long.valueOf(l1.split(" ")[0]);
		long k = Long.valueOf(l1.split(" ")[1]);
		String strH = l2;
		List<Long> h = new ArrayList<Long>();
		for (String element : strH.split(" ")) {
			h.add(Long.valueOf(element));
		}

		Collections.sort(h, Collections.reverseOrder());

		Map<Integer, Long> hMap = new HashMap<>();
		int li = 0;
		for (Long element : h) {
			hMap.put(li, element);
			li++;
		}

		for (int i = 0; i < k; i++) {
			hMap.put(i, Long.valueOf(0));
		}

		long result = 0;
		for (Long element : hMap.values()) {
			result += element;
		}

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

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String l1 = scan.nextLine();
		String l2 = scan.nextLine();
		scan.close();

		long n = Long.valueOf(l1.split(" ")[0]);
		long k = Long.valueOf(l1.split(" ")[1]);
		String strH = l2;
		List<Long> h = new ArrayList<Long>();
		for (String element : strH.split(" ")) {
			h.add(Long.valueOf(element));
		}

		Collections.sort(h, Collections.reverseOrder());

		Map<Integer, Long> hMap = new HashMap<>();
		int li = 0;
		for (Long element : h) {
			hMap.put(li, element);
			li++;
		}

		for (int i = 0; i < k; i++) {
			hMap.put(i, Long.valueOf(0));
		}

		long result = 0;
		for (Long element : hMap.values()) {
			result += element;
		}

		System.out.println(result);
	}
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String l1 = scan.nextLine();
		String l2 = scan.nextLine();
		scan.close();

		long n = Long.valueOf(l1.split(" ")[0]);
		long k = Long.valueOf(l1.split(" ")[1]);
		String strH = l2;
		List<Long> h = new ArrayList<Long>();
		for (String element : strH.split(" ")) {
			h.add(Long.valueOf(element));
		}

		Collections.sort(h, Collections.reverseOrder());

		Map<Integer, Long> hMap = new HashMap<>();
		int li = 0;
		for (Long element : h) {
			hMap.put(li, element);
			li++;
		}

		for (int i = 0; i < k; i++) {
			hMap.put(i, Long.valueOf(0));
		}

		long result = 0;
		for (Long element : hMap.values()) {
			result += element;
		}

		System.out.println(result);
	}
}
