import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        Long[] tmp = new Long[n];
        
        for(int i=0; i<n; i++){
            tmp[i] = sc.nextLong();
        }
        Arrays.sort(tmp);
        
        Long ans = 0L;
        for(int j=0; j<n-k; j++){
            ans += tmp[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 n = sc.nextInt();
        int k = sc.nextInt();
        Long[] tmp = new Long[n];
        
        for(int i=0; i<n; i++){
            tmp[i] = sc.nextLong();
        }
        Arrays.sort(tmp);
        
        Long ans = 0L;
        for(int j=0; j<n-k; j++){
            ans += tmp[j];
        }
        
        System.out.println(ans);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        Long[] tmp = new Long[n];
        
        for(int i=0; i<n; i++){
            tmp[i] = sc.nextLong();
        }
        Arrays.sort(tmp);
        
        Long ans = 0L;
        for(int j=0; j<n-k; j++){
            ans += tmp[j];
        }
        
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        Long[] tmp = new Long[n];
        
        for(int i=0; i<n; i++){
            tmp[i] = sc.nextLong();
        }
        Arrays.sort(tmp);
        
        Long ans = 0L;
        for(int j=0; j<n-k; j++){
            ans += tmp[j];
        }
        
        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 Long[] tmp = new Long[n]; tmp new Long[n] n for(int i=0; i<n; i++){
            tmp[i] = sc.nextLong();
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            tmp[i] = sc.nextLong();
        } {
            tmp[i] = sc.nextLong();
        } tmp[i] = sc.nextLong() tmp[i] tmp i sc.nextLong() sc.nextLong sc Arrays.sort(tmp) Arrays.sort Arrays tmp Long ans = 0L; ans 0L for(int j=0; j<n-k; j++){
            ans += tmp[j];
        } int j=0; int j=0; j 0 j<n-k j n-k n k j++ j++ j {
            ans += tmp[j];
        } {
            ans += tmp[j];
        } ans += tmp[j] ans tmp[j] tmp 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 n = sc.nextInt();
        int k = sc.nextInt();
        Long[] tmp = new Long[n];
        
        for(int i=0; i<n; i++){
            tmp[i] = sc.nextLong();
        }
        Arrays.sort(tmp);
        
        Long ans = 0L;
        for(int j=0; j<n-k; j++){
            ans += tmp[j];
        }
        
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        Long[] tmp = new Long[n];
        
        for(int i=0; i<n; i++){
            tmp[i] = sc.nextLong();
        }
        Arrays.sort(tmp);
        
        Long ans = 0L;
        for(int j=0; j<n-k; j++){
            ans += tmp[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 n = sc.nextInt();
        int k = sc.nextInt();
        Long[] tmp = new Long[n];
        
        for(int i=0; i<n; i++){
            tmp[i] = sc.nextLong();
        }
        Arrays.sort(tmp);
        
        Long ans = 0L;
        for(int j=0; j<n-k; j++){
            ans += tmp[j];
        }
        
        System.out.println(ans);
    }
}