import java.math.BigInteger;
import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int k = scan.nextInt();
        ArrayList<Long> enemy = new ArrayList<Long>(n);
        long count = 0;

        if(n <= k) {System.out.println(count); scan.close();}
        else{
            for(int i = 0;i < n;i++){
                enemy.add(scan.nextLong());
            }
            scan.close();
            Collections.sort(enemy);

            for(int j = 0; j < n-k;j++) count += enemy.get(j);
            System.out.println(count);
        }
    }
} import java.math.BigInteger; BigInteger java.math import java.util.*; util.* java class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int k = scan.nextInt();
        ArrayList<Long> enemy = new ArrayList<Long>(n);
        long count = 0;

        if(n <= k) {System.out.println(count); scan.close();}
        else{
            for(int i = 0;i < n;i++){
                enemy.add(scan.nextLong());
            }
            scan.close();
            Collections.sort(enemy);

            for(int j = 0; j < n-k;j++) count += enemy.get(j);
            System.out.println(count);
        }
    }
} Main public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int k = scan.nextInt();
        ArrayList<Long> enemy = new ArrayList<Long>(n);
        long count = 0;

        if(n <= k) {System.out.println(count); scan.close();}
        else{
            for(int i = 0;i < n;i++){
                enemy.add(scan.nextLong());
            }
            scan.close();
            Collections.sort(enemy);

            for(int j = 0; j < n-k;j++) count += enemy.get(j);
            System.out.println(count);
        }
    } main {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int k = scan.nextInt();
        ArrayList<Long> enemy = new ArrayList<Long>(n);
        long count = 0;

        if(n <= k) {System.out.println(count); scan.close();}
        else{
            for(int i = 0;i < n;i++){
                enemy.add(scan.nextLong());
            }
            scan.close();
            Collections.sort(enemy);

            for(int j = 0; j < n-k;j++) count += enemy.get(j);
            System.out.println(count);
        }
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int k = scan.nextInt(); k scan.nextInt() scan.nextInt scan ArrayList<Long> enemy = new ArrayList<Long>(n); enemy new ArrayList<Long>(n) long count = 0; count 0 if(n <= k) {System.out.println(count); scan.close();}
        else{
            for(int i = 0;i < n;i++){
                enemy.add(scan.nextLong());
            }
            scan.close();
            Collections.sort(enemy);

            for(int j = 0; j < n-k;j++) count += enemy.get(j);
            System.out.println(count);
        } n <= k n k {System.out.println(count); scan.close();} System.out.println(count) System.out.println System.out System System.out count scan.close() scan.close scan {
            for(int i = 0;i < n;i++){
                enemy.add(scan.nextLong());
            }
            scan.close();
            Collections.sort(enemy);

            for(int j = 0; j < n-k;j++) count += enemy.get(j);
            System.out.println(count);
        } for(int i = 0;i < n;i++){
                enemy.add(scan.nextLong());
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                enemy.add(scan.nextLong());
            } {
                enemy.add(scan.nextLong());
            } enemy.add(scan.nextLong()) enemy.add enemy scan.nextLong() scan.nextLong scan scan.close() scan.close scan Collections.sort(enemy) Collections.sort Collections enemy for(int j = 0; j < n-k;j++) count += enemy.get(j); int j = 0; int j = 0; j 0 j < n-k j n-k n k j++ j++ j count += enemy.get(j); count += enemy.get(j) count enemy.get(j) enemy.get enemy j System.out.println(count) System.out.println System.out System System.out count String[] args args
import java.math.BigInteger;
import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int k = scan.nextInt();
        ArrayList<Long> enemy = new ArrayList<Long>(n);
        long count = 0;

        if(n <= k) {System.out.println(count); scan.close();}
        else{
            for(int i = 0;i < n;i++){
                enemy.add(scan.nextLong());
            }
            scan.close();
            Collections.sort(enemy);

            for(int j = 0; j < n-k;j++) count += enemy.get(j);
            System.out.println(count);
        }
    }
}