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

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int n = Integer.parseInt(str[0]);
    long k = Long.parseLong(str[1]);
    str = in.readLine().split(" ");
    long[] h = new long[n];
    long sum = 0;
    for(int i=0; i<n; i++) {
      h[i] = Long.parseLong(str[i]);
    }
    Arrays.sort(h);
    for(int i=0; i<n-k; i++) {
      sum += h[i];
    }
    System.out.println(sum);
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io import java.util.Arrays; Arrays java.util public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int n = Integer.parseInt(str[0]);
    long k = Long.parseLong(str[1]);
    str = in.readLine().split(" ");
    long[] h = new long[n];
    long sum = 0;
    for(int i=0; i<n; i++) {
      h[i] = Long.parseLong(str[i]);
    }
    Arrays.sort(h);
    for(int i=0; i<n-k; i++) {
      sum += h[i];
    }
    System.out.println(sum);
  }
} Main public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int n = Integer.parseInt(str[0]);
    long k = Long.parseLong(str[1]);
    str = in.readLine().split(" ");
    long[] h = new long[n];
    long sum = 0;
    for(int i=0; i<n; i++) {
      h[i] = Long.parseLong(str[i]);
    }
    Arrays.sort(h);
    for(int i=0; i<n-k; i++) {
      sum += h[i];
    }
    System.out.println(sum);
  } main {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int n = Integer.parseInt(str[0]);
    long k = Long.parseLong(str[1]);
    str = in.readLine().split(" ");
    long[] h = new long[n];
    long sum = 0;
    for(int i=0; i<n; i++) {
      h[i] = Long.parseLong(str[i]);
    }
    Arrays.sort(h);
    for(int i=0; i<n-k; i++) {
      sum += h[i];
    }
    System.out.println(sum);
  } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) String[] str = in.readLine().split(" "); str in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " int n = Integer.parseInt(str[0]); n Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 long k = Long.parseLong(str[1]); k Long.parseLong(str[1]) Long.parseLong Long str[1] str 1 str = in.readLine().split(" ") str in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " long[] h = new long[n]; h new long[n] n long sum = 0; sum 0 for(int i=0; i<n; i++) {
      h[i] = Long.parseLong(str[i]);
    } int i=0; int i=0; i 0 i<n i n i++ i++ i {
      h[i] = Long.parseLong(str[i]);
    } {
      h[i] = Long.parseLong(str[i]);
    } h[i] = Long.parseLong(str[i]) h[i] h i Long.parseLong(str[i]) Long.parseLong Long str[i] str i Arrays.sort(h) Arrays.sort Arrays h for(int i=0; i<n-k; i++) {
      sum += h[i];
    } int i=0; int i=0; i 0 i<n-k i n-k n k i++ i++ i {
      sum += h[i];
    } {
      sum += h[i];
    } sum += h[i] sum h[i] h 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 {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int n = Integer.parseInt(str[0]);
    long k = Long.parseLong(str[1]);
    str = in.readLine().split(" ");
    long[] h = new long[n];
    long sum = 0;
    for(int i=0; i<n; i++) {
      h[i] = Long.parseLong(str[i]);
    }
    Arrays.sort(h);
    for(int i=0; i<n-k; i++) {
      sum += h[i];
    }
    System.out.println(sum);
  }
} public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int n = Integer.parseInt(str[0]);
    long k = Long.parseLong(str[1]);
    str = in.readLine().split(" ");
    long[] h = new long[n];
    long sum = 0;
    for(int i=0; i<n; i++) {
      h[i] = Long.parseLong(str[i]);
    }
    Arrays.sort(h);
    for(int i=0; i<n-k; i++) {
      sum += h[i];
    }
    System.out.println(sum);
  }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int n = Integer.parseInt(str[0]);
    long k = Long.parseLong(str[1]);
    str = in.readLine().split(" ");
    long[] h = new long[n];
    long sum = 0;
    for(int i=0; i<n; i++) {
      h[i] = Long.parseLong(str[i]);
    }
    Arrays.sort(h);
    for(int i=0; i<n-k; i++) {
      sum += h[i];
    }
    System.out.println(sum);
  }
}