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

public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num = scan.nextInt();
        int sp_move = scan.nextInt();
        long[] monster = new long[num];
        for (int i = 0; i < num; i++) {
            monster[i] = scan.nextLong();

        }
        Arrays.sort(monster);
        long sum = 0;
        if(sp_move >= num)
            System.out.println(0);
        else{
            for (int i = 0; i < (num-sp_move); i++) {
                sum += monster[i];
            }
            System.out.println(sum);
        }
    }

} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num = scan.nextInt();
        int sp_move = scan.nextInt();
        long[] monster = new long[num];
        for (int i = 0; i < num; i++) {
            monster[i] = scan.nextLong();

        }
        Arrays.sort(monster);
        long sum = 0;
        if(sp_move >= num)
            System.out.println(0);
        else{
            for (int i = 0; i < (num-sp_move); i++) {
                sum += monster[i];
            }
            System.out.println(sum);
        }
    }

} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num = scan.nextInt();
        int sp_move = scan.nextInt();
        long[] monster = new long[num];
        for (int i = 0; i < num; i++) {
            monster[i] = scan.nextLong();

        }
        Arrays.sort(monster);
        long sum = 0;
        if(sp_move >= num)
            System.out.println(0);
        else{
            for (int i = 0; i < (num-sp_move); i++) {
                sum += monster[i];
            }
            System.out.println(sum);
        }
    } main {
        Scanner scan = new Scanner(System.in);
        int num = scan.nextInt();
        int sp_move = scan.nextInt();
        long[] monster = new long[num];
        for (int i = 0; i < num; i++) {
            monster[i] = scan.nextLong();

        }
        Arrays.sort(monster);
        long sum = 0;
        if(sp_move >= num)
            System.out.println(0);
        else{
            for (int i = 0; i < (num-sp_move); i++) {
                sum += monster[i];
            }
            System.out.println(sum);
        }
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int num = scan.nextInt(); num scan.nextInt() scan.nextInt scan int sp_move = scan.nextInt(); sp_move scan.nextInt() scan.nextInt scan long[] monster = new long[num]; monster new long[num] num for (int i = 0; i < num; i++) {
            monster[i] = scan.nextLong();

        } int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
            monster[i] = scan.nextLong();

        } {
            monster[i] = scan.nextLong();

        } monster[i] = scan.nextLong() monster[i] monster i scan.nextLong() scan.nextLong scan Arrays.sort(monster) Arrays.sort Arrays monster long sum = 0; sum 0 if(sp_move >= num)
            System.out.println(0);
        else{
            for (int i = 0; i < (num-sp_move); i++) {
                sum += monster[i];
            }
            System.out.println(sum);
        } sp_move >= num sp_move num System.out.println(0) System.out.println System.out System System.out 0 {
            for (int i = 0; i < (num-sp_move); i++) {
                sum += monster[i];
            }
            System.out.println(sum);
        } for (int i = 0; i < (num-sp_move); i++) {
                sum += monster[i];
            } int i = 0; int i = 0; i 0 i < (num-sp_move) i (num-sp_move) num sp_move i++ i++ i {
                sum += monster[i];
            } {
                sum += monster[i];
            } sum += monster[i] sum monster[i] monster 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 scan = new Scanner(System.in);
        int num = scan.nextInt();
        int sp_move = scan.nextInt();
        long[] monster = new long[num];
        for (int i = 0; i < num; i++) {
            monster[i] = scan.nextLong();

        }
        Arrays.sort(monster);
        long sum = 0;
        if(sp_move >= num)
            System.out.println(0);
        else{
            for (int i = 0; i < (num-sp_move); i++) {
                sum += monster[i];
            }
            System.out.println(sum);
        }
    }

} public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num = scan.nextInt();
        int sp_move = scan.nextInt();
        long[] monster = new long[num];
        for (int i = 0; i < num; i++) {
            monster[i] = scan.nextLong();

        }
        Arrays.sort(monster);
        long sum = 0;
        if(sp_move >= num)
            System.out.println(0);
        else{
            for (int i = 0; i < (num-sp_move); i++) {
                sum += monster[i];
            }
            System.out.println(sum);
        }
    }

} Main

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

public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num = scan.nextInt();
        int sp_move = scan.nextInt();
        long[] monster = new long[num];
        for (int i = 0; i < num; i++) {
            monster[i] = scan.nextLong();

        }
        Arrays.sort(monster);
        long sum = 0;
        if(sp_move >= num)
            System.out.println(0);
        else{
            for (int i = 0; i < (num-sp_move); i++) {
                sum += monster[i];
            }
            System.out.println(sum);
        }
    }

}
