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

public class Main {
    public static void main(String[] args) {
        Main m = new Main();
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());
        int k = Integer.parseInt(scanner.next());
        int at = n - k;
        if (at > 0){
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = Integer.parseInt(scanner.next());
            }
            Arrays.sort(a);
            long atc = 0;
            for (int i = 0; i < at; i++) {
                atc = atc + a[i];
            }
            System.out.println(atc);
        }else {
            System.out.println(0);
        }
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Main m = new Main();
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());
        int k = Integer.parseInt(scanner.next());
        int at = n - k;
        if (at > 0){
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = Integer.parseInt(scanner.next());
            }
            Arrays.sort(a);
            long atc = 0;
            for (int i = 0; i < at; i++) {
                atc = atc + a[i];
            }
            System.out.println(atc);
        }else {
            System.out.println(0);
        }
    }
} Main public static void main(String[] args) {
        Main m = new Main();
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());
        int k = Integer.parseInt(scanner.next());
        int at = n - k;
        if (at > 0){
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = Integer.parseInt(scanner.next());
            }
            Arrays.sort(a);
            long atc = 0;
            for (int i = 0; i < at; i++) {
                atc = atc + a[i];
            }
            System.out.println(atc);
        }else {
            System.out.println(0);
        }
    } main {
        Main m = new Main();
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());
        int k = Integer.parseInt(scanner.next());
        int at = n - k;
        if (at > 0){
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = Integer.parseInt(scanner.next());
            }
            Arrays.sort(a);
            long atc = 0;
            for (int i = 0; i < at; i++) {
                atc = atc + a[i];
            }
            System.out.println(atc);
        }else {
            System.out.println(0);
        }
    } Main m = new Main(); m new Main() Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = Integer.parseInt(scanner.next()); n Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner int k = Integer.parseInt(scanner.next()); k Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner int at = n - k; at n - k n k if (at > 0){
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = Integer.parseInt(scanner.next());
            }
            Arrays.sort(a);
            long atc = 0;
            for (int i = 0; i < at; i++) {
                atc = atc + a[i];
            }
            System.out.println(atc);
        }else {
            System.out.println(0);
        } at > 0 at 0 {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = Integer.parseInt(scanner.next());
            }
            Arrays.sort(a);
            long atc = 0;
            for (int i = 0; i < at; i++) {
                atc = atc + a[i];
            }
            System.out.println(atc);
        } int a[] = new int[n]; a new int[n] n for (int i = 0; i < n; i++) {
                a[i] = Integer.parseInt(scanner.next());
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                a[i] = Integer.parseInt(scanner.next());
            } {
                a[i] = Integer.parseInt(scanner.next());
            } a[i] = Integer.parseInt(scanner.next()) a[i] a i Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner Arrays.sort(a) Arrays.sort Arrays a long atc = 0; atc 0 for (int i = 0; i < at; i++) {
                atc = atc + a[i];
            } int i = 0; int i = 0; i 0 i < at i at i++ i++ i {
                atc = atc + a[i];
            } {
                atc = atc + a[i];
            } atc = atc + a[i] atc atc + a[i] atc a[i] a i System.out.println(atc) System.out.println System.out System System.out atc {
            System.out.println(0);
        } System.out.println(0) System.out.println System.out System System.out 0 String[] args args public class Main {
    public static void main(String[] args) {
        Main m = new Main();
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());
        int k = Integer.parseInt(scanner.next());
        int at = n - k;
        if (at > 0){
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = Integer.parseInt(scanner.next());
            }
            Arrays.sort(a);
            long atc = 0;
            for (int i = 0; i < at; i++) {
                atc = atc + a[i];
            }
            System.out.println(atc);
        }else {
            System.out.println(0);
        }
    }
} public class Main {
    public static void main(String[] args) {
        Main m = new Main();
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());
        int k = Integer.parseInt(scanner.next());
        int at = n - k;
        if (at > 0){
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = Integer.parseInt(scanner.next());
            }
            Arrays.sort(a);
            long atc = 0;
            for (int i = 0; i < at; i++) {
                atc = atc + a[i];
            }
            System.out.println(atc);
        }else {
            System.out.println(0);
        }
    }
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main m = new Main();
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());
        int k = Integer.parseInt(scanner.next());
        int at = n - k;
        if (at > 0){
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = Integer.parseInt(scanner.next());
            }
            Arrays.sort(a);
            long atc = 0;
            for (int i = 0; i < at; i++) {
                atc = atc + a[i];
            }
            System.out.println(atc);
        }else {
            System.out.println(0);
        }
    }
}