import java.util.*;
import java.util.Arrays;
import java.util.Collections;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();
    int k = sc.nextInt();
    LinkedList<Integer> h = new LinkedList<Integer>();
    for(int i = 0; i < n; i++){
      h.add(sc.nextInt());
    }
    Collections.sort(h,  Collections.reverseOrder());
    //char[] a = sc.nextLine().toCharArray();
    for(int i = 0; i < k; i++){
      h.poll();
    }
    double sum = 0;
    for(int i = 0; i < n-k; i++){
      sum += h.poll();
    }
    System.out.println(String.format("%.0f", sum));
  }
} import java.util.*; util.* java import java.util.Arrays; Arrays java.util import java.util.Collections; Collections 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();
    LinkedList<Integer> h = new LinkedList<Integer>();
    for(int i = 0; i < n; i++){
      h.add(sc.nextInt());
    }
    Collections.sort(h,  Collections.reverseOrder());
    //char[] a = sc.nextLine().toCharArray();
    for(int i = 0; i < k; i++){
      h.poll();
    }
    double sum = 0;
    for(int i = 0; i < n-k; i++){
      sum += h.poll();
    }
    System.out.println(String.format("%.0f", sum));
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();
    int k = sc.nextInt();
    LinkedList<Integer> h = new LinkedList<Integer>();
    for(int i = 0; i < n; i++){
      h.add(sc.nextInt());
    }
    Collections.sort(h,  Collections.reverseOrder());
    //char[] a = sc.nextLine().toCharArray();
    for(int i = 0; i < k; i++){
      h.poll();
    }
    double sum = 0;
    for(int i = 0; i < n-k; i++){
      sum += h.poll();
    }
    System.out.println(String.format("%.0f", sum));
  } main {
    Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();
    int k = sc.nextInt();
    LinkedList<Integer> h = new LinkedList<Integer>();
    for(int i = 0; i < n; i++){
      h.add(sc.nextInt());
    }
    Collections.sort(h,  Collections.reverseOrder());
    //char[] a = sc.nextLine().toCharArray();
    for(int i = 0; i < k; i++){
      h.poll();
    }
    double sum = 0;
    for(int i = 0; i < n-k; i++){
      sum += h.poll();
    }
    System.out.println(String.format("%.0f", sum));
  } 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 LinkedList<Integer> h = new LinkedList<Integer>(); h new LinkedList<Integer>() for(int i = 0; i < n; i++){
      h.add(sc.nextInt());
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      h.add(sc.nextInt());
    } {
      h.add(sc.nextInt());
    } h.add(sc.nextInt()) h.add h sc.nextInt() sc.nextInt sc Collections.sort(h,  Collections.reverseOrder()) Collections.sort Collections h Collections.reverseOrder() Collections.reverseOrder Collections for(int i = 0; i < k; i++){
      h.poll();
    } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
      h.poll();
    } {
      h.poll();
    } h.poll() h.poll h double sum = 0; sum 0 for(int i = 0; i < n-k; i++){
      sum += h.poll();
    } int i = 0; int i = 0; i 0 i < n-k i n-k n k i++ i++ i {
      sum += h.poll();
    } {
      sum += h.poll();
    } sum += h.poll() sum h.poll() h.poll h System.out.println(String.format("%.0f", sum)) System.out.println System.out System System.out String.format("%.0f", sum) String.format String "%.0f" sum 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();
    LinkedList<Integer> h = new LinkedList<Integer>();
    for(int i = 0; i < n; i++){
      h.add(sc.nextInt());
    }
    Collections.sort(h,  Collections.reverseOrder());
    //char[] a = sc.nextLine().toCharArray();
    for(int i = 0; i < k; i++){
      h.poll();
    }
    double sum = 0;
    for(int i = 0; i < n-k; i++){
      sum += h.poll();
    }
    System.out.println(String.format("%.0f", sum));
  }
} public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();
    int k = sc.nextInt();
    LinkedList<Integer> h = new LinkedList<Integer>();
    for(int i = 0; i < n; i++){
      h.add(sc.nextInt());
    }
    Collections.sort(h,  Collections.reverseOrder());
    //char[] a = sc.nextLine().toCharArray();
    for(int i = 0; i < k; i++){
      h.poll();
    }
    double sum = 0;
    for(int i = 0; i < n-k; i++){
      sum += h.poll();
    }
    System.out.println(String.format("%.0f", sum));
  }
} Main
import java.util.*;
import java.util.Arrays;
import java.util.Collections;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();
    int k = sc.nextInt();
    LinkedList<Integer> h = new LinkedList<Integer>();
    for(int i = 0; i < n; i++){
      h.add(sc.nextInt());
    }
    Collections.sort(h,  Collections.reverseOrder());
    //char[] a = sc.nextLine().toCharArray();
    for(int i = 0; i < k; i++){
      h.poll();
    }
    double sum = 0;
    for(int i = 0; i < n-k; i++){
      sum += h.poll();
    }
    System.out.println(String.format("%.0f", sum));
  }
}