import java.util.ArrayList;
import java.util.Collection;
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> l = new ArrayList<>();
        for(int i = 0; i < N; i++){
            l.add(sc.nextInt());
        }
        l.sort(null);
        long total = 0;
        for(int i = 0; i < l.size()-K; i++){
            total += l.get(i);
        }
        System.out.println(total);
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Collection; Collection 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> l = new ArrayList<>();
        for(int i = 0; i < N; i++){
            l.add(sc.nextInt());
        }
        l.sort(null);
        long total = 0;
        for(int i = 0; i < l.size()-K; i++){
            total += l.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();
        ArrayList<Integer> l = new ArrayList<>();
        for(int i = 0; i < N; i++){
            l.add(sc.nextInt());
        }
        l.sort(null);
        long total = 0;
        for(int i = 0; i < l.size()-K; i++){
            total += l.get(i);
        }
        System.out.println(total);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        ArrayList<Integer> l = new ArrayList<>();
        for(int i = 0; i < N; i++){
            l.add(sc.nextInt());
        }
        l.sort(null);
        long total = 0;
        for(int i = 0; i < l.size()-K; i++){
            total += l.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 ArrayList<Integer> l = new ArrayList<>(); l new ArrayList<>() for(int i = 0; i < N; i++){
            l.add(sc.nextInt());
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            l.add(sc.nextInt());
        } {
            l.add(sc.nextInt());
        } l.add(sc.nextInt()) l.add l sc.nextInt() sc.nextInt sc l.sort(null) l.sort l null long total = 0; total 0 for(int i = 0; i < l.size()-K; i++){
            total += l.get(i);
        } int i = 0; int i = 0; i 0 i < l.size()-K i l.size()-K l.size() l.size l K i++ i++ i {
            total += l.get(i);
        } {
            total += l.get(i);
        } total += l.get(i) total l.get(i) l.get l 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();
        ArrayList<Integer> l = new ArrayList<>();
        for(int i = 0; i < N; i++){
            l.add(sc.nextInt());
        }
        l.sort(null);
        long total = 0;
        for(int i = 0; i < l.size()-K; i++){
            total += l.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();
        ArrayList<Integer> l = new ArrayList<>();
        for(int i = 0; i < N; i++){
            l.add(sc.nextInt());
        }
        l.sort(null);
        long total = 0;
        for(int i = 0; i < l.size()-K; i++){
            total += l.get(i);
        }
        System.out.println(total);
    }
} Main
import java.util.ArrayList;
import java.util.Collection;
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> l = new ArrayList<>();
        for(int i = 0; i < N; i++){
            l.add(sc.nextInt());
        }
        l.sort(null);
        long total = 0;
        for(int i = 0; i < l.size()-K; i++){
            total += l.get(i);
        }
        System.out.println(total);
    }
}