import java.util.*;

public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer N = Integer.parseInt(scanner.next());
        Integer K = Integer.parseInt(scanner.next());
        Integer[] H = new Integer[N];

        for (int i = 0; i < N; i++) H[i] = Integer.parseInt(scanner.next());

        Arrays.sort(H,  Collections.reverseOrder());
        Long count = 0L;
        for (Integer i = K; i < N; i++) {
            count += H[i];
        }
        System.out.println(count);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer N = Integer.parseInt(scanner.next());
        Integer K = Integer.parseInt(scanner.next());
        Integer[] H = new Integer[N];

        for (int i = 0; i < N; i++) H[i] = Integer.parseInt(scanner.next());

        Arrays.sort(H,  Collections.reverseOrder());
        Long count = 0L;
        for (Integer i = K; i < N; i++) {
            count += H[i];
        }
        System.out.println(count);
    }
} Main public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer N = Integer.parseInt(scanner.next());
        Integer K = Integer.parseInt(scanner.next());
        Integer[] H = new Integer[N];

        for (int i = 0; i < N; i++) H[i] = Integer.parseInt(scanner.next());

        Arrays.sort(H,  Collections.reverseOrder());
        Long count = 0L;
        for (Integer i = K; i < N; i++) {
            count += H[i];
        }
        System.out.println(count);
    } main {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer N = Integer.parseInt(scanner.next());
        Integer K = Integer.parseInt(scanner.next());
        Integer[] H = new Integer[N];

        for (int i = 0; i < N; i++) H[i] = Integer.parseInt(scanner.next());

        Arrays.sort(H,  Collections.reverseOrder());
        Long count = 0L;
        for (Integer i = K; i < N; i++) {
            count += H[i];
        }
        System.out.println(count);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) Integer N = Integer.parseInt(scanner.next()); N Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner Integer K = Integer.parseInt(scanner.next()); K Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner Integer[] H = new Integer[N]; H new Integer[N] N for (int i = 0; i < N; i++) H[i] = Integer.parseInt(scanner.next()); int i = 0; int i = 0; i 0 i < N i N i++ i++ i H[i] = Integer.parseInt(scanner.next()); H[i] = Integer.parseInt(scanner.next()) H[i] H i Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner Arrays.sort(H,  Collections.reverseOrder()) Arrays.sort Arrays H Collections.reverseOrder() Collections.reverseOrder Collections Long count = 0L; count 0L for (Integer i = K; i < N; i++) {
            count += H[i];
        } Integer i = K; Integer i = K; i K i < N i N i++ i++ i {
            count += H[i];
        } {
            count += H[i];
        } count += H[i] count H[i] H i System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer N = Integer.parseInt(scanner.next());
        Integer K = Integer.parseInt(scanner.next());
        Integer[] H = new Integer[N];

        for (int i = 0; i < N; i++) H[i] = Integer.parseInt(scanner.next());

        Arrays.sort(H,  Collections.reverseOrder());
        Long count = 0L;
        for (Integer i = K; i < N; i++) {
            count += H[i];
        }
        System.out.println(count);
    }
} public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer N = Integer.parseInt(scanner.next());
        Integer K = Integer.parseInt(scanner.next());
        Integer[] H = new Integer[N];

        for (int i = 0; i < N; i++) H[i] = Integer.parseInt(scanner.next());

        Arrays.sort(H,  Collections.reverseOrder());
        Long count = 0L;
        for (Integer i = K; i < N; i++) {
            count += H[i];
        }
        System.out.println(count);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer N = Integer.parseInt(scanner.next());
        Integer K = Integer.parseInt(scanner.next());
        Integer[] H = new Integer[N];

        for (int i = 0; i < N; i++) H[i] = Integer.parseInt(scanner.next());

        Arrays.sort(H,  Collections.reverseOrder());
        Long count = 0L;
        for (Integer i = K; i < N; i++) {
            count += H[i];
        }
        System.out.println(count);
    }
}
