import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        ArrayList<Integer> a = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            a.add(sc.nextInt());
        }
        if(n <= k) {
            System.out.println(0);
            return;
        }
        Collections.sort(a);
        for (int i = 0; i < k; i++) {
            a.remove(a.size() - 1);
        }
        long ans = 0l;
        for (Integer i : a) {
            ans += i;
        }
        System.out.println(ans);
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner 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();
        ArrayList<Integer> a = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            a.add(sc.nextInt());
        }
        if(n <= k) {
            System.out.println(0);
            return;
        }
        Collections.sort(a);
        for (int i = 0; i < k; i++) {
            a.remove(a.size() - 1);
        }
        long ans = 0l;
        for (Integer i : a) {
            ans += i;
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        ArrayList<Integer> a = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            a.add(sc.nextInt());
        }
        if(n <= k) {
            System.out.println(0);
            return;
        }
        Collections.sort(a);
        for (int i = 0; i < k; i++) {
            a.remove(a.size() - 1);
        }
        long ans = 0l;
        for (Integer i : a) {
            ans += i;
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        ArrayList<Integer> a = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            a.add(sc.nextInt());
        }
        if(n <= k) {
            System.out.println(0);
            return;
        }
        Collections.sort(a);
        for (int i = 0; i < k; i++) {
            a.remove(a.size() - 1);
        }
        long ans = 0l;
        for (Integer i : a) {
            ans += i;
        }
        System.out.println(ans);
    } 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 ArrayList<Integer> a = new ArrayList<>(); a new ArrayList<>() for (int i = 0; i < n; i++) {
            a.add(sc.nextInt());
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            a.add(sc.nextInt());
        } {
            a.add(sc.nextInt());
        } a.add(sc.nextInt()) a.add a 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; Collections.sort(a) Collections.sort Collections a for (int i = 0; i < k; i++) {
            a.remove(a.size() - 1);
        } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
            a.remove(a.size() - 1);
        } {
            a.remove(a.size() - 1);
        } a.remove(a.size() - 1) a.remove a a.size() - 1 a.size() a.size a 1 long ans = 0l; ans 0l for (Integer i : a) {
            ans += i;
        } Integer i a {
            ans += i;
        } {
            ans += i;
        } ans += i ans i System.out.println(ans) System.out.println System.out System System.out ans 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();
        ArrayList<Integer> a = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            a.add(sc.nextInt());
        }
        if(n <= k) {
            System.out.println(0);
            return;
        }
        Collections.sort(a);
        for (int i = 0; i < k; i++) {
            a.remove(a.size() - 1);
        }
        long ans = 0l;
        for (Integer i : a) {
            ans += i;
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        ArrayList<Integer> a = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            a.add(sc.nextInt());
        }
        if(n <= k) {
            System.out.println(0);
            return;
        }
        Collections.sort(a);
        for (int i = 0; i < k; i++) {
            a.remove(a.size() - 1);
        }
        long ans = 0l;
        for (Integer i : a) {
            ans += i;
        }
        System.out.println(ans);
    }
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        ArrayList<Integer> a = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            a.add(sc.nextInt());
        }
        if(n <= k) {
            System.out.println(0);
            return;
        }
        Collections.sort(a);
        for (int i = 0; i < k; i++) {
            a.remove(a.size() - 1);
        }
        long ans = 0l;
        for (Integer i : a) {
            ans += i;
        }
        System.out.println(ans);
    }
}