
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String[] tmpArray = br.readLine().split(" ");
		
		int n = Integer.parseInt(tmpArray[0]);
		int k = Integer.parseInt(tmpArray[1]);
		
		int c[] = new int[n];
		tmpArray = br.readLine().split(" ");
		
		long sum = 0;
		for(int i = 0; i < n ; i++) {
			c[i] = Integer.parseInt(tmpArray[i]);
		}
		
		Arrays.sort(c);
		
		for(int i = 0; i < n - k; i++) {
			sum += c[i];
		}
		
		System.out.println(sum);
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util public class Main {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String[] tmpArray = br.readLine().split(" ");
		
		int n = Integer.parseInt(tmpArray[0]);
		int k = Integer.parseInt(tmpArray[1]);
		
		int c[] = new int[n];
		tmpArray = br.readLine().split(" ");
		
		long sum = 0;
		for(int i = 0; i < n ; i++) {
			c[i] = Integer.parseInt(tmpArray[i]);
		}
		
		Arrays.sort(c);
		
		for(int i = 0; i < n - k; i++) {
			sum += c[i];
		}
		
		System.out.println(sum);
	}

} Main public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String[] tmpArray = br.readLine().split(" ");
		
		int n = Integer.parseInt(tmpArray[0]);
		int k = Integer.parseInt(tmpArray[1]);
		
		int c[] = new int[n];
		tmpArray = br.readLine().split(" ");
		
		long sum = 0;
		for(int i = 0; i < n ; i++) {
			c[i] = Integer.parseInt(tmpArray[i]);
		}
		
		Arrays.sort(c);
		
		for(int i = 0; i < n - k; i++) {
			sum += c[i];
		}
		
		System.out.println(sum);
	} main {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String[] tmpArray = br.readLine().split(" ");
		
		int n = Integer.parseInt(tmpArray[0]);
		int k = Integer.parseInt(tmpArray[1]);
		
		int c[] = new int[n];
		tmpArray = br.readLine().split(" ");
		
		long sum = 0;
		for(int i = 0; i < n ; i++) {
			c[i] = Integer.parseInt(tmpArray[i]);
		}
		
		Arrays.sort(c);
		
		for(int i = 0; i < n - k; i++) {
			sum += c[i];
		}
		
		System.out.println(sum);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String[] tmpArray = br.readLine().split(" "); tmpArray br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int n = Integer.parseInt(tmpArray[0]); n Integer.parseInt(tmpArray[0]) Integer.parseInt Integer tmpArray[0] tmpArray 0 int k = Integer.parseInt(tmpArray[1]); k Integer.parseInt(tmpArray[1]) Integer.parseInt Integer tmpArray[1] tmpArray 1 int c[] = new int[n]; c new int[n] n tmpArray = br.readLine().split(" ") tmpArray br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " long sum = 0; sum 0 for(int i = 0; i < n ; i++) {
			c[i] = Integer.parseInt(tmpArray[i]);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			c[i] = Integer.parseInt(tmpArray[i]);
		} {
			c[i] = Integer.parseInt(tmpArray[i]);
		} c[i] = Integer.parseInt(tmpArray[i]) c[i] c i Integer.parseInt(tmpArray[i]) Integer.parseInt Integer tmpArray[i] tmpArray i Arrays.sort(c) Arrays.sort Arrays c for(int i = 0; i < n - k; i++) {
			sum += c[i];
		} int i = 0; int i = 0; i 0 i < n - k i n - k n k i++ i++ i {
			sum += c[i];
		} {
			sum += c[i];
		} sum += c[i] sum c[i] c 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 IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String[] tmpArray = br.readLine().split(" ");
		
		int n = Integer.parseInt(tmpArray[0]);
		int k = Integer.parseInt(tmpArray[1]);
		
		int c[] = new int[n];
		tmpArray = br.readLine().split(" ");
		
		long sum = 0;
		for(int i = 0; i < n ; i++) {
			c[i] = Integer.parseInt(tmpArray[i]);
		}
		
		Arrays.sort(c);
		
		for(int i = 0; i < n - k; i++) {
			sum += c[i];
		}
		
		System.out.println(sum);
	}

} public class Main {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String[] tmpArray = br.readLine().split(" ");
		
		int n = Integer.parseInt(tmpArray[0]);
		int k = Integer.parseInt(tmpArray[1]);
		
		int c[] = new int[n];
		tmpArray = br.readLine().split(" ");
		
		long sum = 0;
		for(int i = 0; i < n ; i++) {
			c[i] = Integer.parseInt(tmpArray[i]);
		}
		
		Arrays.sort(c);
		
		for(int i = 0; i < n - k; i++) {
			sum += c[i];
		}
		
		System.out.println(sum);
	}

} Main

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String[] tmpArray = br.readLine().split(" ");
		
		int n = Integer.parseInt(tmpArray[0]);
		int k = Integer.parseInt(tmpArray[1]);
		
		int c[] = new int[n];
		tmpArray = br.readLine().split(" ");
		
		long sum = 0;
		for(int i = 0; i < n ; i++) {
			c[i] = Integer.parseInt(tmpArray[i]);
		}
		
		Arrays.sort(c);
		
		for(int i = 0; i < n - k; i++) {
			sum += c[i];
		}
		
		System.out.println(sum);
	}

}
