import java.util.*;
public class Main {
	public static void main(String[] args){
      	
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		long arr[] = new long[N];
		for (int i = 0; i < arr.length; i++) {
			arr[i] = sc.nextLong();
		}
		Arrays.sort(arr);
		long atk = 0;
		for (int i = 0; i < arr.length-K; i++) {
			atk += arr[i];
		}
		System.out.println(atk);
      	sc.close();
    }
		
		
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
      	
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		long arr[] = new long[N];
		for (int i = 0; i < arr.length; i++) {
			arr[i] = sc.nextLong();
		}
		Arrays.sort(arr);
		long atk = 0;
		for (int i = 0; i < arr.length-K; i++) {
			atk += arr[i];
		}
		System.out.println(atk);
      	sc.close();
    }
		
		
} Main public static void main(String[] args){
      	
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		long arr[] = new long[N];
		for (int i = 0; i < arr.length; i++) {
			arr[i] = sc.nextLong();
		}
		Arrays.sort(arr);
		long atk = 0;
		for (int i = 0; i < arr.length-K; i++) {
			atk += arr[i];
		}
		System.out.println(atk);
      	sc.close();
    } main {
      	
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		long arr[] = new long[N];
		for (int i = 0; i < arr.length; i++) {
			arr[i] = sc.nextLong();
		}
		Arrays.sort(arr);
		long atk = 0;
		for (int i = 0; i < arr.length-K; i++) {
			atk += arr[i];
		}
		System.out.println(atk);
      	sc.close();
    } 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 long arr[] = new long[N]; arr new long[N] N for (int i = 0; i < arr.length; i++) {
			arr[i] = sc.nextLong();
		} int i = 0; int i = 0; i 0 i < arr.length i arr.length arr arr.length i++ i++ i {
			arr[i] = sc.nextLong();
		} {
			arr[i] = sc.nextLong();
		} arr[i] = sc.nextLong() arr[i] arr i sc.nextLong() sc.nextLong sc Arrays.sort(arr) Arrays.sort Arrays arr long atk = 0; atk 0 for (int i = 0; i < arr.length-K; i++) {
			atk += arr[i];
		} int i = 0; int i = 0; i 0 i < arr.length-K i arr.length-K arr.length arr arr.length K i++ i++ i {
			atk += arr[i];
		} {
			atk += arr[i];
		} atk += arr[i] atk arr[i] arr i System.out.println(atk) System.out.println System.out System System.out atk sc.close() sc.close sc 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 arr[] = new long[N];
		for (int i = 0; i < arr.length; i++) {
			arr[i] = sc.nextLong();
		}
		Arrays.sort(arr);
		long atk = 0;
		for (int i = 0; i < arr.length-K; i++) {
			atk += arr[i];
		}
		System.out.println(atk);
      	sc.close();
    }
		
		
} public class Main {
	public static void main(String[] args){
      	
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		long arr[] = new long[N];
		for (int i = 0; i < arr.length; i++) {
			arr[i] = sc.nextLong();
		}
		Arrays.sort(arr);
		long atk = 0;
		for (int i = 0; i < arr.length-K; i++) {
			atk += arr[i];
		}
		System.out.println(atk);
      	sc.close();
    }
		
		
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
      	
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		long arr[] = new long[N];
		for (int i = 0; i < arr.length; i++) {
			arr[i] = sc.nextLong();
		}
		Arrays.sort(arr);
		long atk = 0;
		for (int i = 0; i < arr.length-K; i++) {
			atk += arr[i];
		}
		System.out.println(atk);
      	sc.close();
    }
		
		
}
