import java.util.Arrays;
import java.util.Scanner;
public class Main {
	public static void main(String[] args)throws Exception{
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int K=stdIn.nextInt();
		int H[]=new int[N];
		long sum=0;
		if(N<=K){
			System.out.println(0);
			System.exit(0);
		}
		for(int i=0;i<N;i++){
			H[i]=stdIn.nextInt();
			sum+=H[i];
		}
		Arrays.sort(H);
		for(int i=0;i<K;i++){
			sum-=H[N-1-i];
		}
		System.out.println(sum);
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args)throws Exception{
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int K=stdIn.nextInt();
		int H[]=new int[N];
		long sum=0;
		if(N<=K){
			System.out.println(0);
			System.exit(0);
		}
		for(int i=0;i<N;i++){
			H[i]=stdIn.nextInt();
			sum+=H[i];
		}
		Arrays.sort(H);
		for(int i=0;i<K;i++){
			sum-=H[N-1-i];
		}
		System.out.println(sum);
	}
} Main public static void main(String[] args)throws Exception{
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int K=stdIn.nextInt();
		int H[]=new int[N];
		long sum=0;
		if(N<=K){
			System.out.println(0);
			System.exit(0);
		}
		for(int i=0;i<N;i++){
			H[i]=stdIn.nextInt();
			sum+=H[i];
		}
		Arrays.sort(H);
		for(int i=0;i<K;i++){
			sum-=H[N-1-i];
		}
		System.out.println(sum);
	} main {
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int K=stdIn.nextInt();
		int H[]=new int[N];
		long sum=0;
		if(N<=K){
			System.out.println(0);
			System.exit(0);
		}
		for(int i=0;i<N;i++){
			H[i]=stdIn.nextInt();
			sum+=H[i];
		}
		Arrays.sort(H);
		for(int i=0;i<K;i++){
			sum-=H[N-1-i];
		}
		System.out.println(sum);
	} Scanner stdIn=new Scanner(System.in); stdIn new Scanner(System.in) int N=stdIn.nextInt(); N stdIn.nextInt() stdIn.nextInt stdIn int K=stdIn.nextInt(); K stdIn.nextInt() stdIn.nextInt stdIn int H[]=new int[N]; H new int[N] N long sum=0; sum 0 if(N<=K){
			System.out.println(0);
			System.exit(0);
		} N<=K N K {
			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 for(int i=0;i<N;i++){
			H[i]=stdIn.nextInt();
			sum+=H[i];
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			H[i]=stdIn.nextInt();
			sum+=H[i];
		} {
			H[i]=stdIn.nextInt();
			sum+=H[i];
		} H[i]=stdIn.nextInt() H[i] H i stdIn.nextInt() stdIn.nextInt stdIn sum+=H[i] sum H[i] H i Arrays.sort(H) Arrays.sort Arrays H for(int i=0;i<K;i++){
			sum-=H[N-1-i];
		} int i=0; int i=0; i 0 i<K i K i++ i++ i {
			sum-=H[N-1-i];
		} {
			sum-=H[N-1-i];
		} sum-=H[N-1-i] sum H[N-1-i] H N-1-i N-1-i N 1 i System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
	public static void main(String[] args)throws Exception{
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int K=stdIn.nextInt();
		int H[]=new int[N];
		long sum=0;
		if(N<=K){
			System.out.println(0);
			System.exit(0);
		}
		for(int i=0;i<N;i++){
			H[i]=stdIn.nextInt();
			sum+=H[i];
		}
		Arrays.sort(H);
		for(int i=0;i<K;i++){
			sum-=H[N-1-i];
		}
		System.out.println(sum);
	}
} public class Main {
	public static void main(String[] args)throws Exception{
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int K=stdIn.nextInt();
		int H[]=new int[N];
		long sum=0;
		if(N<=K){
			System.out.println(0);
			System.exit(0);
		}
		for(int i=0;i<N;i++){
			H[i]=stdIn.nextInt();
			sum+=H[i];
		}
		Arrays.sort(H);
		for(int i=0;i<K;i++){
			sum-=H[N-1-i];
		}
		System.out.println(sum);
	}
} Main
import java.util.Arrays;
import java.util.Scanner;
public class Main {
	public static void main(String[] args)throws Exception{
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int K=stdIn.nextInt();
		int H[]=new int[N];
		long sum=0;
		if(N<=K){
			System.out.println(0);
			System.exit(0);
		}
		for(int i=0;i<N;i++){
			H[i]=stdIn.nextInt();
			sum+=H[i];
		}
		Arrays.sort(H);
		for(int i=0;i<K;i++){
			sum-=H[N-1-i];
		}
		System.out.println(sum);
	}
}
