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

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

        int nm = in.nextInt();
        int moves = in.nextInt();
        int health[] = new int[nm];
        long attacks = 0;

        for (int i = 0; i < health.length; i++)
            health[i] = in.nextInt();

        if (moves < nm) {
            Arrays.sort(health);

            for (int i = 0; i < nm - moves; i++)
                attacks += (long) health[i];
        }

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

        int nm = in.nextInt();
        int moves = in.nextInt();
        int health[] = new int[nm];
        long attacks = 0;

        for (int i = 0; i < health.length; i++)
            health[i] = in.nextInt();

        if (moves < nm) {
            Arrays.sort(health);

            for (int i = 0; i < nm - moves; i++)
                attacks += (long) health[i];
        }

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

        int nm = in.nextInt();
        int moves = in.nextInt();
        int health[] = new int[nm];
        long attacks = 0;

        for (int i = 0; i < health.length; i++)
            health[i] = in.nextInt();

        if (moves < nm) {
            Arrays.sort(health);

            for (int i = 0; i < nm - moves; i++)
                attacks += (long) health[i];
        }

        System.out.println(attacks);
        in.close();
    } main {
        Scanner in = new Scanner(System.in);

        int nm = in.nextInt();
        int moves = in.nextInt();
        int health[] = new int[nm];
        long attacks = 0;

        for (int i = 0; i < health.length; i++)
            health[i] = in.nextInt();

        if (moves < nm) {
            Arrays.sort(health);

            for (int i = 0; i < nm - moves; i++)
                attacks += (long) health[i];
        }

        System.out.println(attacks);
        in.close();
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int nm = in.nextInt(); nm in.nextInt() in.nextInt in int moves = in.nextInt(); moves in.nextInt() in.nextInt in int health[] = new int[nm]; health new int[nm] nm long attacks = 0; attacks 0 for (int i = 0; i < health.length; i++)
            health[i] = in.nextInt(); int i = 0; int i = 0; i 0 i < health.length i health.length health health.length i++ i++ i health[i] = in.nextInt(); health[i] = in.nextInt() health[i] health i in.nextInt() in.nextInt in if (moves < nm) {
            Arrays.sort(health);

            for (int i = 0; i < nm - moves; i++)
                attacks += (long) health[i];
        } moves < nm moves nm {
            Arrays.sort(health);

            for (int i = 0; i < nm - moves; i++)
                attacks += (long) health[i];
        } Arrays.sort(health) Arrays.sort Arrays health for (int i = 0; i < nm - moves; i++)
                attacks += (long) health[i]; int i = 0; int i = 0; i 0 i < nm - moves i nm - moves nm moves i++ i++ i attacks += (long) health[i]; attacks += (long) health[i] attacks (long) health[i] health i System.out.println(attacks) System.out.println System.out System System.out attacks in.close() in.close in String[] args args public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int nm = in.nextInt();
        int moves = in.nextInt();
        int health[] = new int[nm];
        long attacks = 0;

        for (int i = 0; i < health.length; i++)
            health[i] = in.nextInt();

        if (moves < nm) {
            Arrays.sort(health);

            for (int i = 0; i < nm - moves; i++)
                attacks += (long) health[i];
        }

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

        int nm = in.nextInt();
        int moves = in.nextInt();
        int health[] = new int[nm];
        long attacks = 0;

        for (int i = 0; i < health.length; i++)
            health[i] = in.nextInt();

        if (moves < nm) {
            Arrays.sort(health);

            for (int i = 0; i < nm - moves; i++)
                attacks += (long) health[i];
        }

        System.out.println(attacks);
        in.close();
    }
} Main
import java.util.Arrays;
import java.util.Scanner;

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

        int nm = in.nextInt();
        int moves = in.nextInt();
        int health[] = new int[nm];
        long attacks = 0;

        for (int i = 0; i < health.length; i++)
            health[i] = in.nextInt();

        if (moves < nm) {
            Arrays.sort(health);

            for (int i = 0; i < nm - moves; i++)
                attacks += (long) health[i];
        }

        System.out.println(attacks);
        in.close();
    }
}