import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();
		List<Long> hi = new ArrayList<Long>();
		for(int i=0; i<n; ++i) {
			hi.add((long) scan.nextInt());
		}

		if(n <= k) {
			System.out.println("0");
		} else {
			Collections.sort(hi, Collections.reverseOrder());

			for(int i=0; i<k; ++i) {
				hi.set(i, (long) 0);
			}
			long sum = 0;
			for(int i=k; i<n; ++i) {
				sum += hi.get(i);
			}
			System.out.println(sum);
		}
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();
		List<Long> hi = new ArrayList<Long>();
		for(int i=0; i<n; ++i) {
			hi.add((long) scan.nextInt());
		}

		if(n <= k) {
			System.out.println("0");
		} else {
			Collections.sort(hi, Collections.reverseOrder());

			for(int i=0; i<k; ++i) {
				hi.set(i, (long) 0);
			}
			long sum = 0;
			for(int i=k; i<n; ++i) {
				sum += hi.get(i);
			}
			System.out.println(sum);
		}
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();
		List<Long> hi = new ArrayList<Long>();
		for(int i=0; i<n; ++i) {
			hi.add((long) scan.nextInt());
		}

		if(n <= k) {
			System.out.println("0");
		} else {
			Collections.sort(hi, Collections.reverseOrder());

			for(int i=0; i<k; ++i) {
				hi.set(i, (long) 0);
			}
			long sum = 0;
			for(int i=k; i<n; ++i) {
				sum += hi.get(i);
			}
			System.out.println(sum);
		}
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();
		List<Long> hi = new ArrayList<Long>();
		for(int i=0; i<n; ++i) {
			hi.add((long) scan.nextInt());
		}

		if(n <= k) {
			System.out.println("0");
		} else {
			Collections.sort(hi, Collections.reverseOrder());

			for(int i=0; i<k; ++i) {
				hi.set(i, (long) 0);
			}
			long sum = 0;
			for(int i=k; i<n; ++i) {
				sum += hi.get(i);
			}
			System.out.println(sum);
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int k = scan.nextInt(); k scan.nextInt() scan.nextInt scan List<Long> hi = new ArrayList<Long>(); hi new ArrayList<Long>() for(int i=0; i<n; ++i) {
			hi.add((long) scan.nextInt());
		} int i=0; int i=0; i 0 i<n i n ++i ++i i {
			hi.add((long) scan.nextInt());
		} {
			hi.add((long) scan.nextInt());
		} hi.add((long) scan.nextInt()) hi.add hi (long) scan.nextInt() scan.nextInt scan if(n <= k) {
			System.out.println("0");
		} else {
			Collections.sort(hi, Collections.reverseOrder());

			for(int i=0; i<k; ++i) {
				hi.set(i, (long) 0);
			}
			long sum = 0;
			for(int i=k; i<n; ++i) {
				sum += hi.get(i);
			}
			System.out.println(sum);
		} n <= k n k {
			System.out.println("0");
		} System.out.println("0") System.out.println System.out System System.out "0" {
			Collections.sort(hi, Collections.reverseOrder());

			for(int i=0; i<k; ++i) {
				hi.set(i, (long) 0);
			}
			long sum = 0;
			for(int i=k; i<n; ++i) {
				sum += hi.get(i);
			}
			System.out.println(sum);
		} Collections.sort(hi, Collections.reverseOrder()) Collections.sort Collections hi Collections.reverseOrder() Collections.reverseOrder Collections for(int i=0; i<k; ++i) {
				hi.set(i, (long) 0);
			} int i=0; int i=0; i 0 i<k i k ++i ++i i {
				hi.set(i, (long) 0);
			} {
				hi.set(i, (long) 0);
			} hi.set(i, (long) 0) hi.set hi i (long) 0 long sum = 0; sum 0 for(int i=k; i<n; ++i) {
				sum += hi.get(i);
			} int i=k; int i=k; i k i<n i n ++i ++i i {
				sum += hi.get(i);
			} {
				sum += hi.get(i);
			} sum += hi.get(i) sum hi.get(i) hi.get hi 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) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();
		List<Long> hi = new ArrayList<Long>();
		for(int i=0; i<n; ++i) {
			hi.add((long) scan.nextInt());
		}

		if(n <= k) {
			System.out.println("0");
		} else {
			Collections.sort(hi, Collections.reverseOrder());

			for(int i=0; i<k; ++i) {
				hi.set(i, (long) 0);
			}
			long sum = 0;
			for(int i=k; i<n; ++i) {
				sum += hi.get(i);
			}
			System.out.println(sum);
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();
		List<Long> hi = new ArrayList<Long>();
		for(int i=0; i<n; ++i) {
			hi.add((long) scan.nextInt());
		}

		if(n <= k) {
			System.out.println("0");
		} else {
			Collections.sort(hi, Collections.reverseOrder());

			for(int i=0; i<k; ++i) {
				hi.set(i, (long) 0);
			}
			long sum = 0;
			for(int i=k; i<n; ++i) {
				sum += hi.get(i);
			}
			System.out.println(sum);
		}
	}
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt();
		List<Long> hi = new ArrayList<Long>();
		for(int i=0; i<n; ++i) {
			hi.add((long) scan.nextInt());
		}

		if(n <= k) {
			System.out.println("0");
		} else {
			Collections.sort(hi, Collections.reverseOrder());

			for(int i=0; i<k; ++i) {
				hi.set(i, (long) 0);
			}
			long sum = 0;
			for(int i=k; i<n; ++i) {
				sum += hi.get(i);
			}
			System.out.println(sum);
		}
	}
}