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) {
    final Scanner scanner = new Scanner(System.in);

    final int numberOfMonsters = scanner.nextInt();
    final int numberOfSpecialMove = scanner.nextInt();
    final List<Integer> hitPoints = new ArrayList<>();
    for (int i = 0; i < numberOfMonsters; i++) {
      hitPoints.add(scanner.nextInt());
    }

    final int numberOfMonstersNeedToAttack = numberOfMonsters - numberOfSpecialMove;
    if (numberOfMonstersNeedToAttack <= 0) {
      System.out.println(0);
    } else {
      Collections.sort(hitPoints);
      long totalOfHitPoints = 0;
      for (int i = 0; i < numberOfMonstersNeedToAttack; i++) {
        totalOfHitPoints += hitPoints.get(i);
      }
      System.out.println(totalOfHitPoints);
    }


  }
} 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) {
    final Scanner scanner = new Scanner(System.in);

    final int numberOfMonsters = scanner.nextInt();
    final int numberOfSpecialMove = scanner.nextInt();
    final List<Integer> hitPoints = new ArrayList<>();
    for (int i = 0; i < numberOfMonsters; i++) {
      hitPoints.add(scanner.nextInt());
    }

    final int numberOfMonstersNeedToAttack = numberOfMonsters - numberOfSpecialMove;
    if (numberOfMonstersNeedToAttack <= 0) {
      System.out.println(0);
    } else {
      Collections.sort(hitPoints);
      long totalOfHitPoints = 0;
      for (int i = 0; i < numberOfMonstersNeedToAttack; i++) {
        totalOfHitPoints += hitPoints.get(i);
      }
      System.out.println(totalOfHitPoints);
    }


  }
} Main public static void main(String[] args) {
    final Scanner scanner = new Scanner(System.in);

    final int numberOfMonsters = scanner.nextInt();
    final int numberOfSpecialMove = scanner.nextInt();
    final List<Integer> hitPoints = new ArrayList<>();
    for (int i = 0; i < numberOfMonsters; i++) {
      hitPoints.add(scanner.nextInt());
    }

    final int numberOfMonstersNeedToAttack = numberOfMonsters - numberOfSpecialMove;
    if (numberOfMonstersNeedToAttack <= 0) {
      System.out.println(0);
    } else {
      Collections.sort(hitPoints);
      long totalOfHitPoints = 0;
      for (int i = 0; i < numberOfMonstersNeedToAttack; i++) {
        totalOfHitPoints += hitPoints.get(i);
      }
      System.out.println(totalOfHitPoints);
    }


  } main {
    final Scanner scanner = new Scanner(System.in);

    final int numberOfMonsters = scanner.nextInt();
    final int numberOfSpecialMove = scanner.nextInt();
    final List<Integer> hitPoints = new ArrayList<>();
    for (int i = 0; i < numberOfMonsters; i++) {
      hitPoints.add(scanner.nextInt());
    }

    final int numberOfMonstersNeedToAttack = numberOfMonsters - numberOfSpecialMove;
    if (numberOfMonstersNeedToAttack <= 0) {
      System.out.println(0);
    } else {
      Collections.sort(hitPoints);
      long totalOfHitPoints = 0;
      for (int i = 0; i < numberOfMonstersNeedToAttack; i++) {
        totalOfHitPoints += hitPoints.get(i);
      }
      System.out.println(totalOfHitPoints);
    }


  } final Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) final int numberOfMonsters = scanner.nextInt(); numberOfMonsters scanner.nextInt() scanner.nextInt scanner final int numberOfSpecialMove = scanner.nextInt(); numberOfSpecialMove scanner.nextInt() scanner.nextInt scanner final List<Integer> hitPoints = new ArrayList<>(); hitPoints new ArrayList<>() for (int i = 0; i < numberOfMonsters; i++) {
      hitPoints.add(scanner.nextInt());
    } int i = 0; int i = 0; i 0 i < numberOfMonsters i numberOfMonsters i++ i++ i {
      hitPoints.add(scanner.nextInt());
    } {
      hitPoints.add(scanner.nextInt());
    } hitPoints.add(scanner.nextInt()) hitPoints.add hitPoints scanner.nextInt() scanner.nextInt scanner final int numberOfMonstersNeedToAttack = numberOfMonsters - numberOfSpecialMove; numberOfMonstersNeedToAttack numberOfMonsters - numberOfSpecialMove numberOfMonsters numberOfSpecialMove if (numberOfMonstersNeedToAttack <= 0) {
      System.out.println(0);
    } else {
      Collections.sort(hitPoints);
      long totalOfHitPoints = 0;
      for (int i = 0; i < numberOfMonstersNeedToAttack; i++) {
        totalOfHitPoints += hitPoints.get(i);
      }
      System.out.println(totalOfHitPoints);
    } numberOfMonstersNeedToAttack <= 0 numberOfMonstersNeedToAttack 0 {
      System.out.println(0);
    } System.out.println(0) System.out.println System.out System System.out 0 {
      Collections.sort(hitPoints);
      long totalOfHitPoints = 0;
      for (int i = 0; i < numberOfMonstersNeedToAttack; i++) {
        totalOfHitPoints += hitPoints.get(i);
      }
      System.out.println(totalOfHitPoints);
    } Collections.sort(hitPoints) Collections.sort Collections hitPoints long totalOfHitPoints = 0; totalOfHitPoints 0 for (int i = 0; i < numberOfMonstersNeedToAttack; i++) {
        totalOfHitPoints += hitPoints.get(i);
      } int i = 0; int i = 0; i 0 i < numberOfMonstersNeedToAttack i numberOfMonstersNeedToAttack i++ i++ i {
        totalOfHitPoints += hitPoints.get(i);
      } {
        totalOfHitPoints += hitPoints.get(i);
      } totalOfHitPoints += hitPoints.get(i) totalOfHitPoints hitPoints.get(i) hitPoints.get hitPoints i System.out.println(totalOfHitPoints) System.out.println System.out System System.out totalOfHitPoints String[] args args public class Main {

  public static void main(String[] args) {
    final Scanner scanner = new Scanner(System.in);

    final int numberOfMonsters = scanner.nextInt();
    final int numberOfSpecialMove = scanner.nextInt();
    final List<Integer> hitPoints = new ArrayList<>();
    for (int i = 0; i < numberOfMonsters; i++) {
      hitPoints.add(scanner.nextInt());
    }

    final int numberOfMonstersNeedToAttack = numberOfMonsters - numberOfSpecialMove;
    if (numberOfMonstersNeedToAttack <= 0) {
      System.out.println(0);
    } else {
      Collections.sort(hitPoints);
      long totalOfHitPoints = 0;
      for (int i = 0; i < numberOfMonstersNeedToAttack; i++) {
        totalOfHitPoints += hitPoints.get(i);
      }
      System.out.println(totalOfHitPoints);
    }


  }
} public class Main {

  public static void main(String[] args) {
    final Scanner scanner = new Scanner(System.in);

    final int numberOfMonsters = scanner.nextInt();
    final int numberOfSpecialMove = scanner.nextInt();
    final List<Integer> hitPoints = new ArrayList<>();
    for (int i = 0; i < numberOfMonsters; i++) {
      hitPoints.add(scanner.nextInt());
    }

    final int numberOfMonstersNeedToAttack = numberOfMonsters - numberOfSpecialMove;
    if (numberOfMonstersNeedToAttack <= 0) {
      System.out.println(0);
    } else {
      Collections.sort(hitPoints);
      long totalOfHitPoints = 0;
      for (int i = 0; i < numberOfMonstersNeedToAttack; i++) {
        totalOfHitPoints += hitPoints.get(i);
      }
      System.out.println(totalOfHitPoints);
    }


  }
} Main
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) {
    final Scanner scanner = new Scanner(System.in);

    final int numberOfMonsters = scanner.nextInt();
    final int numberOfSpecialMove = scanner.nextInt();
    final List<Integer> hitPoints = new ArrayList<>();
    for (int i = 0; i < numberOfMonsters; i++) {
      hitPoints.add(scanner.nextInt());
    }

    final int numberOfMonstersNeedToAttack = numberOfMonsters - numberOfSpecialMove;
    if (numberOfMonstersNeedToAttack <= 0) {
      System.out.println(0);
    } else {
      Collections.sort(hitPoints);
      long totalOfHitPoints = 0;
      for (int i = 0; i < numberOfMonstersNeedToAttack; i++) {
        totalOfHitPoints += hitPoints.get(i);
      }
      System.out.println(totalOfHitPoints);
    }


  }
}