//package atcoder;
 
import java.util.*;
import java.math.BigDecimal;
 
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		//long H[] = new long[N];
		ArrayList<Long> list = new ArrayList<Long>();
		for(int i=0;i<N;i++) {
			list.add(sc.nextLong());
		}
		if(K>=N) {
			System.out.println(0);
			System.exit(0);
		}
		
		list.sort(Comparator.reverseOrder());
		
		
		
		for(int j=0;j<K;j++) {
		    list.set(j,(long)0);
		}
		long souwa2 = 0;
		for(int k=0;k<N;k++) {
			long a = list.get(k);
			souwa2 += a;
		}
		System.out.println(souwa2);
					
		}
} import java.util.*; util.* java import java.math.BigDecimal; BigDecimal java.math public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		//long H[] = new long[N];
		ArrayList<Long> list = new ArrayList<Long>();
		for(int i=0;i<N;i++) {
			list.add(sc.nextLong());
		}
		if(K>=N) {
			System.out.println(0);
			System.exit(0);
		}
		
		list.sort(Comparator.reverseOrder());
		
		
		
		for(int j=0;j<K;j++) {
		    list.set(j,(long)0);
		}
		long souwa2 = 0;
		for(int k=0;k<N;k++) {
			long a = list.get(k);
			souwa2 += a;
		}
		System.out.println(souwa2);
					
		}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		//long H[] = new long[N];
		ArrayList<Long> list = new ArrayList<Long>();
		for(int i=0;i<N;i++) {
			list.add(sc.nextLong());
		}
		if(K>=N) {
			System.out.println(0);
			System.exit(0);
		}
		
		list.sort(Comparator.reverseOrder());
		
		
		
		for(int j=0;j<K;j++) {
		    list.set(j,(long)0);
		}
		long souwa2 = 0;
		for(int k=0;k<N;k++) {
			long a = list.get(k);
			souwa2 += a;
		}
		System.out.println(souwa2);
					
		} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		//long H[] = new long[N];
		ArrayList<Long> list = new ArrayList<Long>();
		for(int i=0;i<N;i++) {
			list.add(sc.nextLong());
		}
		if(K>=N) {
			System.out.println(0);
			System.exit(0);
		}
		
		list.sort(Comparator.reverseOrder());
		
		
		
		for(int j=0;j<K;j++) {
		    list.set(j,(long)0);
		}
		long souwa2 = 0;
		for(int k=0;k<N;k++) {
			long a = list.get(k);
			souwa2 += a;
		}
		System.out.println(souwa2);
					
		} 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 ArrayList<Long> list = new ArrayList<Long>(); list new ArrayList<Long>() for(int i=0;i<N;i++) {
			list.add(sc.nextLong());
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			list.add(sc.nextLong());
		} {
			list.add(sc.nextLong());
		} list.add(sc.nextLong()) list.add list sc.nextLong() sc.nextLong sc if(K>=N) {
			System.out.println(0);
			System.exit(0);
		} K>=N K N {
			System.out.println(0);
			System.exit(0);
		} System.out.println(0) System.out.println System.out System System.out 0 System.exit(0) System.exit System 0 list.sort(Comparator.reverseOrder()) list.sort list Comparator.reverseOrder() Comparator.reverseOrder Comparator for(int j=0;j<K;j++) {
		    list.set(j,(long)0);
		} int j=0; int j=0; j 0 j<K j K j++ j++ j {
		    list.set(j,(long)0);
		} {
		    list.set(j,(long)0);
		} list.set(j,(long)0) list.set list j (long)0 long souwa2 = 0; souwa2 0 for(int k=0;k<N;k++) {
			long a = list.get(k);
			souwa2 += a;
		} int k=0; int k=0; k 0 k<N k N k++ k++ k {
			long a = list.get(k);
			souwa2 += a;
		} {
			long a = list.get(k);
			souwa2 += a;
		} long a = list.get(k); a list.get(k) list.get list k souwa2 += a souwa2 a System.out.println(souwa2) System.out.println System.out System System.out souwa2 String[] args args public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		//long H[] = new long[N];
		ArrayList<Long> list = new ArrayList<Long>();
		for(int i=0;i<N;i++) {
			list.add(sc.nextLong());
		}
		if(K>=N) {
			System.out.println(0);
			System.exit(0);
		}
		
		list.sort(Comparator.reverseOrder());
		
		
		
		for(int j=0;j<K;j++) {
		    list.set(j,(long)0);
		}
		long souwa2 = 0;
		for(int k=0;k<N;k++) {
			long a = list.get(k);
			souwa2 += a;
		}
		System.out.println(souwa2);
					
		}
} public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		//long H[] = new long[N];
		ArrayList<Long> list = new ArrayList<Long>();
		for(int i=0;i<N;i++) {
			list.add(sc.nextLong());
		}
		if(K>=N) {
			System.out.println(0);
			System.exit(0);
		}
		
		list.sort(Comparator.reverseOrder());
		
		
		
		for(int j=0;j<K;j++) {
		    list.set(j,(long)0);
		}
		long souwa2 = 0;
		for(int k=0;k<N;k++) {
			long a = list.get(k);
			souwa2 += a;
		}
		System.out.println(souwa2);
					
		}
} Main
//package atcoder;
 
import java.util.*;
import java.math.BigDecimal;
 
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		//long H[] = new long[N];
		ArrayList<Long> list = new ArrayList<Long>();
		for(int i=0;i<N;i++) {
			list.add(sc.nextLong());
		}
		if(K>=N) {
			System.out.println(0);
			System.exit(0);
		}
		
		list.sort(Comparator.reverseOrder());
		
		
		
		for(int j=0;j<K;j++) {
		    list.set(j,(long)0);
		}
		long souwa2 = 0;
		for(int k=0;k<N;k++) {
			long a = list.get(k);
			souwa2 += a;
		}
		System.out.println(souwa2);
					
		}
}