import java.util.Scanner;
import java.util.Arrays;

class Main {
  public static void main(String args[]) {

    Scanner scan = new Scanner(System.in);
    int num = scan.nextInt();
    int skill = scan.nextInt();
    long count = 0;
    int[] mon = new int[num];

    for(int i = 0; i < num; i++){
      mon[i] = scan.nextInt();
    }

    Arrays.sort(mon);
    for(int i = num - 1; i >= 0; i--){
      if (skill == 0){
        break;
      }
      mon[i] = 0;
      skill--;
    }

    for(int i = 0; i < num; i++){
      count += mon[i];
    }
    //for(int i = 0; i < num; i++){
      //System.out.println(mon[i]);
    //}

    System.out.println(count);
  }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util class Main {
  public static void main(String args[]) {

    Scanner scan = new Scanner(System.in);
    int num = scan.nextInt();
    int skill = scan.nextInt();
    long count = 0;
    int[] mon = new int[num];

    for(int i = 0; i < num; i++){
      mon[i] = scan.nextInt();
    }

    Arrays.sort(mon);
    for(int i = num - 1; i >= 0; i--){
      if (skill == 0){
        break;
      }
      mon[i] = 0;
      skill--;
    }

    for(int i = 0; i < num; i++){
      count += mon[i];
    }
    //for(int i = 0; i < num; i++){
      //System.out.println(mon[i]);
    //}

    System.out.println(count);
  }
} Main public static void main(String args[]) {

    Scanner scan = new Scanner(System.in);
    int num = scan.nextInt();
    int skill = scan.nextInt();
    long count = 0;
    int[] mon = new int[num];

    for(int i = 0; i < num; i++){
      mon[i] = scan.nextInt();
    }

    Arrays.sort(mon);
    for(int i = num - 1; i >= 0; i--){
      if (skill == 0){
        break;
      }
      mon[i] = 0;
      skill--;
    }

    for(int i = 0; i < num; i++){
      count += mon[i];
    }
    //for(int i = 0; i < num; i++){
      //System.out.println(mon[i]);
    //}

    System.out.println(count);
  } main {

    Scanner scan = new Scanner(System.in);
    int num = scan.nextInt();
    int skill = scan.nextInt();
    long count = 0;
    int[] mon = new int[num];

    for(int i = 0; i < num; i++){
      mon[i] = scan.nextInt();
    }

    Arrays.sort(mon);
    for(int i = num - 1; i >= 0; i--){
      if (skill == 0){
        break;
      }
      mon[i] = 0;
      skill--;
    }

    for(int i = 0; i < num; i++){
      count += mon[i];
    }
    //for(int i = 0; i < num; i++){
      //System.out.println(mon[i]);
    //}

    System.out.println(count);
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int num = scan.nextInt(); num scan.nextInt() scan.nextInt scan int skill = scan.nextInt(); skill scan.nextInt() scan.nextInt scan long count = 0; count 0 int[] mon = new int[num]; mon new int[num] num for(int i = 0; i < num; i++){
      mon[i] = scan.nextInt();
    } int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
      mon[i] = scan.nextInt();
    } {
      mon[i] = scan.nextInt();
    } mon[i] = scan.nextInt() mon[i] mon i scan.nextInt() scan.nextInt scan Arrays.sort(mon) Arrays.sort Arrays mon for(int i = num - 1; i >= 0; i--){
      if (skill == 0){
        break;
      }
      mon[i] = 0;
      skill--;
    } int i = num - 1; int i = num - 1; i num - 1 num 1 i >= 0 i 0 i-- i-- i {
      if (skill == 0){
        break;
      }
      mon[i] = 0;
      skill--;
    } {
      if (skill == 0){
        break;
      }
      mon[i] = 0;
      skill--;
    } if (skill == 0){
        break;
      } skill == 0 skill 0 {
        break;
      } break; mon[i] = 0 mon[i] mon i 0 skill-- skill for(int i = 0; i < num; i++){
      count += mon[i];
    } int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
      count += mon[i];
    } {
      count += mon[i];
    } count += mon[i] count mon[i] mon i System.out.println(count) System.out.println System.out System System.out count String args[] args
import java.util.Scanner;
import java.util.Arrays;

class Main {
  public static void main(String args[]) {

    Scanner scan = new Scanner(System.in);
    int num = scan.nextInt();
    int skill = scan.nextInt();
    long count = 0;
    int[] mon = new int[num];

    for(int i = 0; i < num; i++){
      mon[i] = scan.nextInt();
    }

    Arrays.sort(mon);
    for(int i = num - 1; i >= 0; i--){
      if (skill == 0){
        break;
      }
      mon[i] = 0;
      skill--;
    }

    for(int i = 0; i < num; i++){
      count += mon[i];
    }
    //for(int i = 0; i < num; i++){
      //System.out.println(mon[i]);
    //}

    System.out.println(count);
  }
}
