import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String[] line = br.readLine().split(" ");
		
		int h = Integer.parseInt(line[0]);
		int k = Integer.parseInt(line[1]);
		line = br.readLine().split(" ");
		br.close();
		List<Long> mons = new ArrayList<Long>();
		for(String s:line) {
			mons.add(Long.parseLong(s));
		}
		
		Collections.sort(mons,Collections.reverseOrder());
		
		long count = 0;
		for(int i=0;i<mons.size();i++) {
			if(i<k) continue;
			count += mons.get(i);
		}
		System.out.println(count);
		
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util import java.util.List; List java.util public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String[] line = br.readLine().split(" ");
		
		int h = Integer.parseInt(line[0]);
		int k = Integer.parseInt(line[1]);
		line = br.readLine().split(" ");
		br.close();
		List<Long> mons = new ArrayList<Long>();
		for(String s:line) {
			mons.add(Long.parseLong(s));
		}
		
		Collections.sort(mons,Collections.reverseOrder());
		
		long count = 0;
		for(int i=0;i<mons.size();i++) {
			if(i<k) continue;
			count += mons.get(i);
		}
		System.out.println(count);
		
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String[] line = br.readLine().split(" ");
		
		int h = Integer.parseInt(line[0]);
		int k = Integer.parseInt(line[1]);
		line = br.readLine().split(" ");
		br.close();
		List<Long> mons = new ArrayList<Long>();
		for(String s:line) {
			mons.add(Long.parseLong(s));
		}
		
		Collections.sort(mons,Collections.reverseOrder());
		
		long count = 0;
		for(int i=0;i<mons.size();i++) {
			if(i<k) continue;
			count += mons.get(i);
		}
		System.out.println(count);
		
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String[] line = br.readLine().split(" ");
		
		int h = Integer.parseInt(line[0]);
		int k = Integer.parseInt(line[1]);
		line = br.readLine().split(" ");
		br.close();
		List<Long> mons = new ArrayList<Long>();
		for(String s:line) {
			mons.add(Long.parseLong(s));
		}
		
		Collections.sort(mons,Collections.reverseOrder());
		
		long count = 0;
		for(int i=0;i<mons.size();i++) {
			if(i<k) continue;
			count += mons.get(i);
		}
		System.out.println(count);
		
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String[] line = br.readLine().split(" "); line br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int h = Integer.parseInt(line[0]); h Integer.parseInt(line[0]) Integer.parseInt Integer line[0] line 0 int k = Integer.parseInt(line[1]); k Integer.parseInt(line[1]) Integer.parseInt Integer line[1] line 1 line = br.readLine().split(" ") line br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " br.close() br.close br List<Long> mons = new ArrayList<Long>(); mons new ArrayList<Long>() for(String s:line) {
			mons.add(Long.parseLong(s));
		} String s line {
			mons.add(Long.parseLong(s));
		} {
			mons.add(Long.parseLong(s));
		} mons.add(Long.parseLong(s)) mons.add mons Long.parseLong(s) Long.parseLong Long s Collections.sort(mons,Collections.reverseOrder()) Collections.sort Collections mons Collections.reverseOrder() Collections.reverseOrder Collections long count = 0; count 0 for(int i=0;i<mons.size();i++) {
			if(i<k) continue;
			count += mons.get(i);
		} int i=0; int i=0; i 0 i<mons.size() i mons.size() mons.size mons i++ i++ i {
			if(i<k) continue;
			count += mons.get(i);
		} {
			if(i<k) continue;
			count += mons.get(i);
		} if(i<k) continue; i<k i k continue; count += mons.get(i) count mons.get(i) mons.get mons i System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String[] line = br.readLine().split(" ");
		
		int h = Integer.parseInt(line[0]);
		int k = Integer.parseInt(line[1]);
		line = br.readLine().split(" ");
		br.close();
		List<Long> mons = new ArrayList<Long>();
		for(String s:line) {
			mons.add(Long.parseLong(s));
		}
		
		Collections.sort(mons,Collections.reverseOrder());
		
		long count = 0;
		for(int i=0;i<mons.size();i++) {
			if(i<k) continue;
			count += mons.get(i);
		}
		System.out.println(count);
		
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String[] line = br.readLine().split(" ");
		
		int h = Integer.parseInt(line[0]);
		int k = Integer.parseInt(line[1]);
		line = br.readLine().split(" ");
		br.close();
		List<Long> mons = new ArrayList<Long>();
		for(String s:line) {
			mons.add(Long.parseLong(s));
		}
		
		Collections.sort(mons,Collections.reverseOrder());
		
		long count = 0;
		for(int i=0;i<mons.size();i++) {
			if(i<k) continue;
			count += mons.get(i);
		}
		System.out.println(count);
		
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String[] line = br.readLine().split(" ");
		
		int h = Integer.parseInt(line[0]);
		int k = Integer.parseInt(line[1]);
		line = br.readLine().split(" ");
		br.close();
		List<Long> mons = new ArrayList<Long>();
		for(String s:line) {
			mons.add(Long.parseLong(s));
		}
		
		Collections.sort(mons,Collections.reverseOrder());
		
		long count = 0;
		for(int i=0;i<mons.size();i++) {
			if(i<k) continue;
			count += mons.get(i);
		}
		System.out.println(count);
		
	}
}
