import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int M = sc.nextInt();
        int K = sc.nextInt();
        int[] mons = new int[M];
        for(int i=0; i<M; i++){
            mons[i] = sc.nextInt();
        }
        long ans = 0;
        Arrays.sort(mons);
        for(int j=0; j<(M-K); j++){
            ans += mons[j];
        }
        System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int M = sc.nextInt();
        int K = sc.nextInt();
        int[] mons = new int[M];
        for(int i=0; i<M; i++){
            mons[i] = sc.nextInt();
        }
        long ans = 0;
        Arrays.sort(mons);
        for(int j=0; j<(M-K); j++){
            ans += mons[j];
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int M = sc.nextInt();
        int K = sc.nextInt();
        int[] mons = new int[M];
        for(int i=0; i<M; i++){
            mons[i] = sc.nextInt();
        }
        long ans = 0;
        Arrays.sort(mons);
        for(int j=0; j<(M-K); j++){
            ans += mons[j];
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int M = sc.nextInt();
        int K = sc.nextInt();
        int[] mons = new int[M];
        for(int i=0; i<M; i++){
            mons[i] = sc.nextInt();
        }
        long ans = 0;
        Arrays.sort(mons);
        for(int j=0; j<(M-K); j++){
            ans += mons[j];
        }
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int M = sc.nextInt(); M sc.nextInt() sc.nextInt sc int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc int[] mons = new int[M]; mons new int[M] M for(int i=0; i<M; i++){
            mons[i] = sc.nextInt();
        } int i=0; int i=0; i 0 i<M i M i++ i++ i {
            mons[i] = sc.nextInt();
        } {
            mons[i] = sc.nextInt();
        } mons[i] = sc.nextInt() mons[i] mons i sc.nextInt() sc.nextInt sc long ans = 0; ans 0 Arrays.sort(mons) Arrays.sort Arrays mons for(int j=0; j<(M-K); j++){
            ans += mons[j];
        } int j=0; int j=0; j 0 j<(M-K) j (M-K) M K j++ j++ j {
            ans += mons[j];
        } {
            ans += mons[j];
        } ans += mons[j] ans mons[j] mons j 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) throws Exception {
        Scanner sc = new Scanner(System.in);
        int M = sc.nextInt();
        int K = sc.nextInt();
        int[] mons = new int[M];
        for(int i=0; i<M; i++){
            mons[i] = sc.nextInt();
        }
        long ans = 0;
        Arrays.sort(mons);
        for(int j=0; j<(M-K); j++){
            ans += mons[j];
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int M = sc.nextInt();
        int K = sc.nextInt();
        int[] mons = new int[M];
        for(int i=0; i<M; i++){
            mons[i] = sc.nextInt();
        }
        long ans = 0;
        Arrays.sort(mons);
        for(int j=0; j<(M-K); j++){
            ans += mons[j];
        }
        System.out.println(ans);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int M = sc.nextInt();
        int K = sc.nextInt();
        int[] mons = new int[M];
        for(int i=0; i<M; i++){
            mons[i] = sc.nextInt();
        }
        long ans = 0;
        Arrays.sort(mons);
        for(int j=0; j<(M-K); j++){
            ans += mons[j];
        }
        System.out.println(ans);
    }
}
