import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        List<Integer> hps = new ArrayList<>(n);
        for (int i = 0; i < n; i++) {
            int hp = scanner.nextInt();
            hps.add(hp);
        }
        hps.sort(Comparator.reverseOrder());
        long result = 0;
        for (int i = k; i < n; i++) {
            result += hps.get(i);
        }
        System.out.println(result);
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Comparator; Comparator java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        List<Integer> hps = new ArrayList<>(n);
        for (int i = 0; i < n; i++) {
            int hp = scanner.nextInt();
            hps.add(hp);
        }
        hps.sort(Comparator.reverseOrder());
        long result = 0;
        for (int i = k; i < n; i++) {
            result += hps.get(i);
        }
        System.out.println(result);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        List<Integer> hps = new ArrayList<>(n);
        for (int i = 0; i < n; i++) {
            int hp = scanner.nextInt();
            hps.add(hp);
        }
        hps.sort(Comparator.reverseOrder());
        long result = 0;
        for (int i = k; i < n; i++) {
            result += hps.get(i);
        }
        System.out.println(result);
    } main {
        Scanner scanner = new Scanner(System.in);
        
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        List<Integer> hps = new ArrayList<>(n);
        for (int i = 0; i < n; i++) {
            int hp = scanner.nextInt();
            hps.add(hp);
        }
        hps.sort(Comparator.reverseOrder());
        long result = 0;
        for (int i = k; i < n; i++) {
            result += hps.get(i);
        }
        System.out.println(result);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int k = scanner.nextInt(); k scanner.nextInt() scanner.nextInt scanner List<Integer> hps = new ArrayList<>(n); hps new ArrayList<>(n) for (int i = 0; i < n; i++) {
            int hp = scanner.nextInt();
            hps.add(hp);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            int hp = scanner.nextInt();
            hps.add(hp);
        } {
            int hp = scanner.nextInt();
            hps.add(hp);
        } int hp = scanner.nextInt(); hp scanner.nextInt() scanner.nextInt scanner hps.add(hp) hps.add hps hp hps.sort(Comparator.reverseOrder()) hps.sort hps Comparator.reverseOrder() Comparator.reverseOrder Comparator long result = 0; result 0 for (int i = k; i < n; i++) {
            result += hps.get(i);
        } int i = k; int i = k; i k i < n i n i++ i++ i {
            result += hps.get(i);
        } {
            result += hps.get(i);
        } result += hps.get(i) result hps.get(i) hps.get hps i System.out.println(result) System.out.println System.out System System.out result String[] args args
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

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