import java.math.BigDecimal;
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 sc = new Scanner(System.in);

    int targets = sc.nextInt();
    int skills = sc.nextInt();

    if (skills >= targets) {
      System.out.println("0");
      return;
    }

    List<BigDecimal> enemies = new ArrayList<>();
    for (int i = 0; i < targets; i++) {
      enemies.add(new BigDecimal(sc.nextInt()));
    }

    enemies.sort(Collections.reverseOrder());

    if (skills > 0) {
      enemies.subList(0, skills).clear();
    }

    BigDecimal total = new BigDecimal(0);
    for (BigDecimal enemy : enemies) {
      total = total.add(enemy);
    }

    System.out.println(total.longValue());
  }
} import java.math.BigDecimal; BigDecimal java.math 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 sc = new Scanner(System.in);

    int targets = sc.nextInt();
    int skills = sc.nextInt();

    if (skills >= targets) {
      System.out.println("0");
      return;
    }

    List<BigDecimal> enemies = new ArrayList<>();
    for (int i = 0; i < targets; i++) {
      enemies.add(new BigDecimal(sc.nextInt()));
    }

    enemies.sort(Collections.reverseOrder());

    if (skills > 0) {
      enemies.subList(0, skills).clear();
    }

    BigDecimal total = new BigDecimal(0);
    for (BigDecimal enemy : enemies) {
      total = total.add(enemy);
    }

    System.out.println(total.longValue());
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int targets = sc.nextInt();
    int skills = sc.nextInt();

    if (skills >= targets) {
      System.out.println("0");
      return;
    }

    List<BigDecimal> enemies = new ArrayList<>();
    for (int i = 0; i < targets; i++) {
      enemies.add(new BigDecimal(sc.nextInt()));
    }

    enemies.sort(Collections.reverseOrder());

    if (skills > 0) {
      enemies.subList(0, skills).clear();
    }

    BigDecimal total = new BigDecimal(0);
    for (BigDecimal enemy : enemies) {
      total = total.add(enemy);
    }

    System.out.println(total.longValue());
  } main {
    Scanner sc = new Scanner(System.in);

    int targets = sc.nextInt();
    int skills = sc.nextInt();

    if (skills >= targets) {
      System.out.println("0");
      return;
    }

    List<BigDecimal> enemies = new ArrayList<>();
    for (int i = 0; i < targets; i++) {
      enemies.add(new BigDecimal(sc.nextInt()));
    }

    enemies.sort(Collections.reverseOrder());

    if (skills > 0) {
      enemies.subList(0, skills).clear();
    }

    BigDecimal total = new BigDecimal(0);
    for (BigDecimal enemy : enemies) {
      total = total.add(enemy);
    }

    System.out.println(total.longValue());
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int targets = sc.nextInt(); targets sc.nextInt() sc.nextInt sc int skills = sc.nextInt(); skills sc.nextInt() sc.nextInt sc if (skills >= targets) {
      System.out.println("0");
      return;
    } skills >= targets skills targets {
      System.out.println("0");
      return;
    } System.out.println("0") System.out.println System.out System System.out "0" return; List<BigDecimal> enemies = new ArrayList<>(); enemies new ArrayList<>() for (int i = 0; i < targets; i++) {
      enemies.add(new BigDecimal(sc.nextInt()));
    } int i = 0; int i = 0; i 0 i < targets i targets i++ i++ i {
      enemies.add(new BigDecimal(sc.nextInt()));
    } {
      enemies.add(new BigDecimal(sc.nextInt()));
    } enemies.add(new BigDecimal(sc.nextInt())) enemies.add enemies new BigDecimal(sc.nextInt()) enemies.sort(Collections.reverseOrder()) enemies.sort enemies Collections.reverseOrder() Collections.reverseOrder Collections if (skills > 0) {
      enemies.subList(0, skills).clear();
    } skills > 0 skills 0 {
      enemies.subList(0, skills).clear();
    } enemies.subList(0, skills).clear() enemies.subList(0, skills).clear enemies.subList(0, skills) enemies.subList enemies 0 skills BigDecimal total = new BigDecimal(0); total new BigDecimal(0) for (BigDecimal enemy : enemies) {
      total = total.add(enemy);
    } BigDecimal enemy enemies {
      total = total.add(enemy);
    } {
      total = total.add(enemy);
    } total = total.add(enemy) total total.add(enemy) total.add total enemy System.out.println(total.longValue()) System.out.println System.out System System.out total.longValue() total.longValue total String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int targets = sc.nextInt();
    int skills = sc.nextInt();

    if (skills >= targets) {
      System.out.println("0");
      return;
    }

    List<BigDecimal> enemies = new ArrayList<>();
    for (int i = 0; i < targets; i++) {
      enemies.add(new BigDecimal(sc.nextInt()));
    }

    enemies.sort(Collections.reverseOrder());

    if (skills > 0) {
      enemies.subList(0, skills).clear();
    }

    BigDecimal total = new BigDecimal(0);
    for (BigDecimal enemy : enemies) {
      total = total.add(enemy);
    }

    System.out.println(total.longValue());
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int targets = sc.nextInt();
    int skills = sc.nextInt();

    if (skills >= targets) {
      System.out.println("0");
      return;
    }

    List<BigDecimal> enemies = new ArrayList<>();
    for (int i = 0; i < targets; i++) {
      enemies.add(new BigDecimal(sc.nextInt()));
    }

    enemies.sort(Collections.reverseOrder());

    if (skills > 0) {
      enemies.subList(0, skills).clear();
    }

    BigDecimal total = new BigDecimal(0);
    for (BigDecimal enemy : enemies) {
      total = total.add(enemy);
    }

    System.out.println(total.longValue());
  }
} Main
import java.math.BigDecimal;
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 sc = new Scanner(System.in);

    int targets = sc.nextInt();
    int skills = sc.nextInt();

    if (skills >= targets) {
      System.out.println("0");
      return;
    }

    List<BigDecimal> enemies = new ArrayList<>();
    for (int i = 0; i < targets; i++) {
      enemies.add(new BigDecimal(sc.nextInt()));
    }

    enemies.sort(Collections.reverseOrder());

    if (skills > 0) {
      enemies.subList(0, skills).clear();
    }

    BigDecimal total = new BigDecimal(0);
    for (BigDecimal enemy : enemies) {
      total = total.add(enemy);
    }

    System.out.println(total.longValue());
  }
}
