import java.util.Scanner;
import java.util.*;
 
public class Main {
	public static void main(String[] args) {
        try (Scanner scn = new Scanner(System.in)) {
            int n = scn.nextInt();
            int k = scn.nextInt();
            scn.nextLine();
            long total = 0;
            if(n>k) {
                List<Long> listH = new ArrayList<>();
                for (int i = 0; i < n; i++) {
                    listH.add(scn.nextLong());
                }
                listH.sort(Collections.reverseOrder());
                if (k > 0) {
                    listH.subList(0, k).clear();
                }
                for(long l:listH){
                    total = total + l;
                }
            }
            System.out.println(total);
        }
	}
	
} import java.util.Scanner; Scanner java.util import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
        try (Scanner scn = new Scanner(System.in)) {
            int n = scn.nextInt();
            int k = scn.nextInt();
            scn.nextLine();
            long total = 0;
            if(n>k) {
                List<Long> listH = new ArrayList<>();
                for (int i = 0; i < n; i++) {
                    listH.add(scn.nextLong());
                }
                listH.sort(Collections.reverseOrder());
                if (k > 0) {
                    listH.subList(0, k).clear();
                }
                for(long l:listH){
                    total = total + l;
                }
            }
            System.out.println(total);
        }
	}
	
} Main public static void main(String[] args) {
        try (Scanner scn = new Scanner(System.in)) {
            int n = scn.nextInt();
            int k = scn.nextInt();
            scn.nextLine();
            long total = 0;
            if(n>k) {
                List<Long> listH = new ArrayList<>();
                for (int i = 0; i < n; i++) {
                    listH.add(scn.nextLong());
                }
                listH.sort(Collections.reverseOrder());
                if (k > 0) {
                    listH.subList(0, k).clear();
                }
                for(long l:listH){
                    total = total + l;
                }
            }
            System.out.println(total);
        }
	} main {
        try (Scanner scn = new Scanner(System.in)) {
            int n = scn.nextInt();
            int k = scn.nextInt();
            scn.nextLine();
            long total = 0;
            if(n>k) {
                List<Long> listH = new ArrayList<>();
                for (int i = 0; i < n; i++) {
                    listH.add(scn.nextLong());
                }
                listH.sort(Collections.reverseOrder());
                if (k > 0) {
                    listH.subList(0, k).clear();
                }
                for(long l:listH){
                    total = total + l;
                }
            }
            System.out.println(total);
        }
	} try (Scanner scn = new Scanner(System.in)) {
            int n = scn.nextInt();
            int k = scn.nextInt();
            scn.nextLine();
            long total = 0;
            if(n>k) {
                List<Long> listH = new ArrayList<>();
                for (int i = 0; i < n; i++) {
                    listH.add(scn.nextLong());
                }
                listH.sort(Collections.reverseOrder());
                if (k > 0) {
                    listH.subList(0, k).clear();
                }
                for(long l:listH){
                    total = total + l;
                }
            }
            System.out.println(total);
        } {
            int n = scn.nextInt();
            int k = scn.nextInt();
            scn.nextLine();
            long total = 0;
            if(n>k) {
                List<Long> listH = new ArrayList<>();
                for (int i = 0; i < n; i++) {
                    listH.add(scn.nextLong());
                }
                listH.sort(Collections.reverseOrder());
                if (k > 0) {
                    listH.subList(0, k).clear();
                }
                for(long l:listH){
                    total = total + l;
                }
            }
            System.out.println(total);
        } Scanner scn = new Scanner(System.in) Scanner scn = new Scanner(System.in) new Scanner(System.in) int n = scn.nextInt(); n scn.nextInt() scn.nextInt scn int k = scn.nextInt(); k scn.nextInt() scn.nextInt scn scn.nextLine() scn.nextLine scn long total = 0; total 0 if(n>k) {
                List<Long> listH = new ArrayList<>();
                for (int i = 0; i < n; i++) {
                    listH.add(scn.nextLong());
                }
                listH.sort(Collections.reverseOrder());
                if (k > 0) {
                    listH.subList(0, k).clear();
                }
                for(long l:listH){
                    total = total + l;
                }
            } n>k n k {
                List<Long> listH = new ArrayList<>();
                for (int i = 0; i < n; i++) {
                    listH.add(scn.nextLong());
                }
                listH.sort(Collections.reverseOrder());
                if (k > 0) {
                    listH.subList(0, k).clear();
                }
                for(long l:listH){
                    total = total + l;
                }
            } List<Long> listH = new ArrayList<>(); listH new ArrayList<>() for (int i = 0; i < n; i++) {
                    listH.add(scn.nextLong());
                } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                    listH.add(scn.nextLong());
                } {
                    listH.add(scn.nextLong());
                } listH.add(scn.nextLong()) listH.add listH scn.nextLong() scn.nextLong scn listH.sort(Collections.reverseOrder()) listH.sort listH Collections.reverseOrder() Collections.reverseOrder Collections if (k > 0) {
                    listH.subList(0, k).clear();
                } k > 0 k 0 {
                    listH.subList(0, k).clear();
                } listH.subList(0, k).clear() listH.subList(0, k).clear listH.subList(0, k) listH.subList listH 0 k for(long l:listH){
                    total = total + l;
                } long l listH {
                    total = total + l;
                } {
                    total = total + l;
                } total = total + l total total + l total l 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) {
        try (Scanner scn = new Scanner(System.in)) {
            int n = scn.nextInt();
            int k = scn.nextInt();
            scn.nextLine();
            long total = 0;
            if(n>k) {
                List<Long> listH = new ArrayList<>();
                for (int i = 0; i < n; i++) {
                    listH.add(scn.nextLong());
                }
                listH.sort(Collections.reverseOrder());
                if (k > 0) {
                    listH.subList(0, k).clear();
                }
                for(long l:listH){
                    total = total + l;
                }
            }
            System.out.println(total);
        }
	}
	
} public class Main {
	public static void main(String[] args) {
        try (Scanner scn = new Scanner(System.in)) {
            int n = scn.nextInt();
            int k = scn.nextInt();
            scn.nextLine();
            long total = 0;
            if(n>k) {
                List<Long> listH = new ArrayList<>();
                for (int i = 0; i < n; i++) {
                    listH.add(scn.nextLong());
                }
                listH.sort(Collections.reverseOrder());
                if (k > 0) {
                    listH.subList(0, k).clear();
                }
                for(long l:listH){
                    total = total + l;
                }
            }
            System.out.println(total);
        }
	}
	
} Main
import java.util.Scanner;
import java.util.*;
 
public class Main {
	public static void main(String[] args) {
        try (Scanner scn = new Scanner(System.in)) {
            int n = scn.nextInt();
            int k = scn.nextInt();
            scn.nextLine();
            long total = 0;
            if(n>k) {
                List<Long> listH = new ArrayList<>();
                for (int i = 0; i < n; i++) {
                    listH.add(scn.nextLong());
                }
                listH.sort(Collections.reverseOrder());
                if (k > 0) {
                    listH.subList(0, k).clear();
                }
                for(long l:listH){
                    total = total + l;
                }
            }
            System.out.println(total);
        }
	}
	
}
