import java.util.*;

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

        if (n <= k) {
            System.out.println(0);
            return;
        }

        List<Integer> hpList = new ArrayList<>();
        for (int i = 0; i < n; i++) hpList.add(sc.nextInt());
        Collections.sort(hpList, Comparator.reverseOrder());
        
        long result = 0;
        for (int i = k; i < n; i++) result += hpList.get(i);

        System.out.println(result);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();

        if (n <= k) {
            System.out.println(0);
            return;
        }

        List<Integer> hpList = new ArrayList<>();
        for (int i = 0; i < n; i++) hpList.add(sc.nextInt());
        Collections.sort(hpList, Comparator.reverseOrder());
        
        long result = 0;
        for (int i = k; i < n; i++) result += hpList.get(i);

        System.out.println(result);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();

        if (n <= k) {
            System.out.println(0);
            return;
        }

        List<Integer> hpList = new ArrayList<>();
        for (int i = 0; i < n; i++) hpList.add(sc.nextInt());
        Collections.sort(hpList, Comparator.reverseOrder());
        
        long result = 0;
        for (int i = k; i < n; i++) result += hpList.get(i);

        System.out.println(result);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();

        if (n <= k) {
            System.out.println(0);
            return;
        }

        List<Integer> hpList = new ArrayList<>();
        for (int i = 0; i < n; i++) hpList.add(sc.nextInt());
        Collections.sort(hpList, Comparator.reverseOrder());
        
        long result = 0;
        for (int i = k; i < n; i++) result += hpList.get(i);

        System.out.println(result);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc if (n <= k) {
            System.out.println(0);
            return;
        } n <= k n k {
            System.out.println(0);
            return;
        } System.out.println(0) System.out.println System.out System System.out 0 return; List<Integer> hpList = new ArrayList<>(); hpList new ArrayList<>() for (int i = 0; i < n; i++) hpList.add(sc.nextInt()); int i = 0; int i = 0; i 0 i < n i n i++ i++ i hpList.add(sc.nextInt()); hpList.add(sc.nextInt()) hpList.add hpList sc.nextInt() sc.nextInt sc Collections.sort(hpList, Comparator.reverseOrder()) Collections.sort Collections hpList Comparator.reverseOrder() Comparator.reverseOrder Comparator long result = 0; result 0 for (int i = k; i < n; i++) result += hpList.get(i); int i = k; int i = k; i k i < n i n i++ i++ i result += hpList.get(i); result += hpList.get(i) result hpList.get(i) hpList.get hpList i System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();

        if (n <= k) {
            System.out.println(0);
            return;
        }

        List<Integer> hpList = new ArrayList<>();
        for (int i = 0; i < n; i++) hpList.add(sc.nextInt());
        Collections.sort(hpList, Comparator.reverseOrder());
        
        long result = 0;
        for (int i = k; i < n; i++) result += hpList.get(i);

        System.out.println(result);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();

        if (n <= k) {
            System.out.println(0);
            return;
        }

        List<Integer> hpList = new ArrayList<>();
        for (int i = 0; i < n; i++) hpList.add(sc.nextInt());
        Collections.sort(hpList, Comparator.reverseOrder());
        
        long result = 0;
        for (int i = k; i < n; i++) result += hpList.get(i);

        System.out.println(result);
    }
} Main
import java.util.*;

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

        if (n <= k) {
            System.out.println(0);
            return;
        }

        List<Integer> hpList = new ArrayList<>();
        for (int i = 0; i < n; i++) hpList.add(sc.nextInt());
        Collections.sort(hpList, Comparator.reverseOrder());
        
        long result = 0;
        for (int i = k; i < n; i++) result += hpList.get(i);

        System.out.println(result);
    }
}