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 scanner = new Scanner(System.in);
        int numberOfMonsters = scanner.nextInt();
        int numberOfSpecialAttacks = scanner.nextInt();

        List<Integer> monsters = new ArrayList<>();
        for (int i = 0; i < numberOfMonsters; i++) {
            monsters.add(scanner.nextInt());
        }
        Collections.sort(monsters);

        long sum = 0;
        for (int i = 0; i < (monsters.size() - numberOfSpecialAttacks); i++) {
            sum += monsters.get(i);
        }
        System.out.println(sum);
    }
} 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 scanner = new Scanner(System.in);
        int numberOfMonsters = scanner.nextInt();
        int numberOfSpecialAttacks = scanner.nextInt();

        List<Integer> monsters = new ArrayList<>();
        for (int i = 0; i < numberOfMonsters; i++) {
            monsters.add(scanner.nextInt());
        }
        Collections.sort(monsters);

        long sum = 0;
        for (int i = 0; i < (monsters.size() - numberOfSpecialAttacks); i++) {
            sum += monsters.get(i);
        }
        System.out.println(sum);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int numberOfMonsters = scanner.nextInt();
        int numberOfSpecialAttacks = scanner.nextInt();

        List<Integer> monsters = new ArrayList<>();
        for (int i = 0; i < numberOfMonsters; i++) {
            monsters.add(scanner.nextInt());
        }
        Collections.sort(monsters);

        long sum = 0;
        for (int i = 0; i < (monsters.size() - numberOfSpecialAttacks); i++) {
            sum += monsters.get(i);
        }
        System.out.println(sum);
    } main {
        Scanner scanner = new Scanner(System.in);
        int numberOfMonsters = scanner.nextInt();
        int numberOfSpecialAttacks = scanner.nextInt();

        List<Integer> monsters = new ArrayList<>();
        for (int i = 0; i < numberOfMonsters; i++) {
            monsters.add(scanner.nextInt());
        }
        Collections.sort(monsters);

        long sum = 0;
        for (int i = 0; i < (monsters.size() - numberOfSpecialAttacks); i++) {
            sum += monsters.get(i);
        }
        System.out.println(sum);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int numberOfMonsters = scanner.nextInt(); numberOfMonsters scanner.nextInt() scanner.nextInt scanner int numberOfSpecialAttacks = scanner.nextInt(); numberOfSpecialAttacks scanner.nextInt() scanner.nextInt scanner List<Integer> monsters = new ArrayList<>(); monsters new ArrayList<>() for (int i = 0; i < numberOfMonsters; i++) {
            monsters.add(scanner.nextInt());
        } int i = 0; int i = 0; i 0 i < numberOfMonsters i numberOfMonsters i++ i++ i {
            monsters.add(scanner.nextInt());
        } {
            monsters.add(scanner.nextInt());
        } monsters.add(scanner.nextInt()) monsters.add monsters scanner.nextInt() scanner.nextInt scanner Collections.sort(monsters) Collections.sort Collections monsters long sum = 0; sum 0 for (int i = 0; i < (monsters.size() - numberOfSpecialAttacks); i++) {
            sum += monsters.get(i);
        } int i = 0; int i = 0; i 0 i < (monsters.size() - numberOfSpecialAttacks) i (monsters.size() - numberOfSpecialAttacks) monsters.size() monsters.size monsters numberOfSpecialAttacks i++ i++ i {
            sum += monsters.get(i);
        } {
            sum += monsters.get(i);
        } sum += monsters.get(i) sum monsters.get(i) monsters.get monsters 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) {
        Scanner scanner = new Scanner(System.in);
        int numberOfMonsters = scanner.nextInt();
        int numberOfSpecialAttacks = scanner.nextInt();

        List<Integer> monsters = new ArrayList<>();
        for (int i = 0; i < numberOfMonsters; i++) {
            monsters.add(scanner.nextInt());
        }
        Collections.sort(monsters);

        long sum = 0;
        for (int i = 0; i < (monsters.size() - numberOfSpecialAttacks); i++) {
            sum += monsters.get(i);
        }
        System.out.println(sum);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int numberOfMonsters = scanner.nextInt();
        int numberOfSpecialAttacks = scanner.nextInt();

        List<Integer> monsters = new ArrayList<>();
        for (int i = 0; i < numberOfMonsters; i++) {
            monsters.add(scanner.nextInt());
        }
        Collections.sort(monsters);

        long sum = 0;
        for (int i = 0; i < (monsters.size() - numberOfSpecialAttacks); i++) {
            sum += monsters.get(i);
        }
        System.out.println(sum);
    }
} 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) {
        Scanner scanner = new Scanner(System.in);
        int numberOfMonsters = scanner.nextInt();
        int numberOfSpecialAttacks = scanner.nextInt();

        List<Integer> monsters = new ArrayList<>();
        for (int i = 0; i < numberOfMonsters; i++) {
            monsters.add(scanner.nextInt());
        }
        Collections.sort(monsters);

        long sum = 0;
        for (int i = 0; i < (monsters.size() - numberOfSpecialAttacks); i++) {
            sum += monsters.get(i);
        }
        System.out.println(sum);
    }
}