import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
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();
        List<Long> list = new ArrayList<>();
        for(long i=0; i<n; i++) {
            list.add(sc.nextLong());
        }
        if(n <= k) {
            System.out.println(0);
            return;
        }
        Collections.sort(list);
        long total = 0;
        for(int i = n; i >= 0; i--, k--) {
            if(k >= 0) continue;
            total += list.get(i);
        }
        System.out.println(total);
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.List; List 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();
        List<Long> list = new ArrayList<>();
        for(long i=0; i<n; i++) {
            list.add(sc.nextLong());
        }
        if(n <= k) {
            System.out.println(0);
            return;
        }
        Collections.sort(list);
        long total = 0;
        for(int i = n; i >= 0; i--, k--) {
            if(k >= 0) continue;
            total += list.get(i);
        }
        System.out.println(total);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        List<Long> list = new ArrayList<>();
        for(long i=0; i<n; i++) {
            list.add(sc.nextLong());
        }
        if(n <= k) {
            System.out.println(0);
            return;
        }
        Collections.sort(list);
        long total = 0;
        for(int i = n; i >= 0; i--, k--) {
            if(k >= 0) continue;
            total += list.get(i);
        }
        System.out.println(total);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        List<Long> list = new ArrayList<>();
        for(long i=0; i<n; i++) {
            list.add(sc.nextLong());
        }
        if(n <= k) {
            System.out.println(0);
            return;
        }
        Collections.sort(list);
        long total = 0;
        for(int i = n; i >= 0; i--, k--) {
            if(k >= 0) continue;
            total += list.get(i);
        }
        System.out.println(total);
    } 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 List<Long> list = new ArrayList<>(); list new ArrayList<>() for(long i=0; i<n; i++) {
            list.add(sc.nextLong());
        } long i=0; long i=0; i 0 i<n i n i++ i++ i {
            list.add(sc.nextLong());
        } {
            list.add(sc.nextLong());
        } list.add(sc.nextLong()) list.add list sc.nextLong() sc.nextLong 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(list) Collections.sort Collections list long total = 0; total 0 for(int i = n; i >= 0; i--, k--) {
            if(k >= 0) continue;
            total += list.get(i);
        } int i = n; int i = n; i n i >= 0 i 0 i--, k-- i-- i k-- k {
            if(k >= 0) continue;
            total += list.get(i);
        } {
            if(k >= 0) continue;
            total += list.get(i);
        } if(k >= 0) continue; k >= 0 k 0 continue; total += list.get(i) total list.get(i) list.get list i System.out.println(total) System.out.println System.out System System.out total 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();
        List<Long> list = new ArrayList<>();
        for(long i=0; i<n; i++) {
            list.add(sc.nextLong());
        }
        if(n <= k) {
            System.out.println(0);
            return;
        }
        Collections.sort(list);
        long total = 0;
        for(int i = n; i >= 0; i--, k--) {
            if(k >= 0) continue;
            total += list.get(i);
        }
        System.out.println(total);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        List<Long> list = new ArrayList<>();
        for(long i=0; i<n; i++) {
            list.add(sc.nextLong());
        }
        if(n <= k) {
            System.out.println(0);
            return;
        }
        Collections.sort(list);
        long total = 0;
        for(int i = n; i >= 0; i--, k--) {
            if(k >= 0) continue;
            total += list.get(i);
        }
        System.out.println(total);
    }
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
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();
        List<Long> list = new ArrayList<>();
        for(long i=0; i<n; i++) {
            list.add(sc.nextLong());
        }
        if(n <= k) {
            System.out.println(0);
            return;
        }
        Collections.sort(list);
        long total = 0;
        for(int i = n; i >= 0; i--, k--) {
            if(k >= 0) continue;
            total += list.get(i);
        }
        System.out.println(total);
    }
}