import java.util.*;
import java.io.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    long count = 0;
    long[] H = new long[n];
    for (int i = 0; i < n; i++) {
      H[i] = sc.nextLong();
    }
    Arrays.sort(H);
    if (n <= k) {
      count = 0;
    } else {
      for (int i = n - 1 - k; i >= 0; i--) {
        count += H[i];
      }
    }
    System.out.println(count);
  }
} import java.util.*; util.* java import java.io.*; io.* 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 count = 0;
    long[] H = new long[n];
    for (int i = 0; i < n; i++) {
      H[i] = sc.nextLong();
    }
    Arrays.sort(H);
    if (n <= k) {
      count = 0;
    } else {
      for (int i = n - 1 - k; i >= 0; i--) {
        count += H[i];
      }
    }
    System.out.println(count);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    long count = 0;
    long[] H = new long[n];
    for (int i = 0; i < n; i++) {
      H[i] = sc.nextLong();
    }
    Arrays.sort(H);
    if (n <= k) {
      count = 0;
    } else {
      for (int i = n - 1 - k; i >= 0; i--) {
        count += H[i];
      }
    }
    System.out.println(count);
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    long count = 0;
    long[] H = new long[n];
    for (int i = 0; i < n; i++) {
      H[i] = sc.nextLong();
    }
    Arrays.sort(H);
    if (n <= k) {
      count = 0;
    } else {
      for (int i = n - 1 - k; i >= 0; i--) {
        count += H[i];
      }
    }
    System.out.println(count);
  } 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 count = 0; count 0 long[] H = new long[n]; H new long[n] n for (int i = 0; i < n; i++) {
      H[i] = sc.nextLong();
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      H[i] = sc.nextLong();
    } {
      H[i] = sc.nextLong();
    } H[i] = sc.nextLong() H[i] H i sc.nextLong() sc.nextLong sc Arrays.sort(H) Arrays.sort Arrays H if (n <= k) {
      count = 0;
    } else {
      for (int i = n - 1 - k; i >= 0; i--) {
        count += H[i];
      }
    } n <= k n k {
      count = 0;
    } count = 0 count 0 {
      for (int i = n - 1 - k; i >= 0; i--) {
        count += H[i];
      }
    } for (int i = n - 1 - k; i >= 0; i--) {
        count += H[i];
      } int i = n - 1 - k; int i = n - 1 - k; i n - 1 - k n - 1 - k n 1 k i >= 0 i 0 i-- i-- i {
        count += H[i];
      } {
        count += H[i];
      } count += H[i] count H[i] H i System.out.println(count) System.out.println System.out System System.out count 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 count = 0;
    long[] H = new long[n];
    for (int i = 0; i < n; i++) {
      H[i] = sc.nextLong();
    }
    Arrays.sort(H);
    if (n <= k) {
      count = 0;
    } else {
      for (int i = n - 1 - k; i >= 0; i--) {
        count += H[i];
      }
    }
    System.out.println(count);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    long count = 0;
    long[] H = new long[n];
    for (int i = 0; i < n; i++) {
      H[i] = sc.nextLong();
    }
    Arrays.sort(H);
    if (n <= k) {
      count = 0;
    } else {
      for (int i = n - 1 - k; i >= 0; i--) {
        count += H[i];
      }
    }
    System.out.println(count);
  }
} Main
import java.util.*;
import java.io.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    long count = 0;
    long[] H = new long[n];
    for (int i = 0; i < n; i++) {
      H[i] = sc.nextLong();
    }
    Arrays.sort(H);
    if (n <= k) {
      count = 0;
    } else {
      for (int i = n - 1 - k; i >= 0; i--) {
        count += H[i];
      }
    }
    System.out.println(count);
  }
}