public class Main {
    public static void main(String args[]) {
        java.util.Scanner sc = new java.util.Scanner(System.in);
        int n = sc.nextInt(), k = sc.nextInt();
        int h[] = new int[n];
        for (int i = 0; i < n; i++) {
            h[i] = sc.nextInt();
        }
        java.util.Arrays.sort(h);
        long ans = 0;
        for (int i = 0; i < Math.max(0, n - k); i++) {
            ans += h[i];
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String args[]) {
        java.util.Scanner sc = new java.util.Scanner(System.in);
        int n = sc.nextInt(), k = sc.nextInt();
        int h[] = new int[n];
        for (int i = 0; i < n; i++) {
            h[i] = sc.nextInt();
        }
        java.util.Arrays.sort(h);
        long ans = 0;
        for (int i = 0; i < Math.max(0, n - k); i++) {
            ans += h[i];
        }
        System.out.println(ans);
    }
} Main public static void main(String args[]) {
        java.util.Scanner sc = new java.util.Scanner(System.in);
        int n = sc.nextInt(), k = sc.nextInt();
        int h[] = new int[n];
        for (int i = 0; i < n; i++) {
            h[i] = sc.nextInt();
        }
        java.util.Arrays.sort(h);
        long ans = 0;
        for (int i = 0; i < Math.max(0, n - k); i++) {
            ans += h[i];
        }
        System.out.println(ans);
    } main {
        java.util.Scanner sc = new java.util.Scanner(System.in);
        int n = sc.nextInt(), k = sc.nextInt();
        int h[] = new int[n];
        for (int i = 0; i < n; i++) {
            h[i] = sc.nextInt();
        }
        java.util.Arrays.sort(h);
        long ans = 0;
        for (int i = 0; i < Math.max(0, n - k); i++) {
            ans += h[i];
        }
        System.out.println(ans);
    } java.util.Scanner sc = new java.util.Scanner(System.in); sc new java.util.Scanner(System.in) int n = sc.nextInt() n sc.nextInt() sc.nextInt sc k = sc.nextInt(); k sc.nextInt() sc.nextInt sc int h[] = new int[n]; h new int[n] n for (int i = 0; i < n; i++) {
            h[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            h[i] = sc.nextInt();
        } {
            h[i] = sc.nextInt();
        } h[i] = sc.nextInt() h[i] h i sc.nextInt() sc.nextInt sc java.util.Arrays.sort(h) java.util.Arrays.sort java.util.Arrays java.util java java.util java.util.Arrays h long ans = 0; ans 0 for (int i = 0; i < Math.max(0, n - k); i++) {
            ans += h[i];
        } int i = 0; int i = 0; i 0 i < Math.max(0, n - k) i Math.max(0, n - k) Math.max Math 0 n - k n k i++ i++ i {
            ans += h[i];
        } {
            ans += h[i];
        } ans += h[i] ans h[i] h i 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[]) {
        java.util.Scanner sc = new java.util.Scanner(System.in);
        int n = sc.nextInt(), k = sc.nextInt();
        int h[] = new int[n];
        for (int i = 0; i < n; i++) {
            h[i] = sc.nextInt();
        }
        java.util.Arrays.sort(h);
        long ans = 0;
        for (int i = 0; i < Math.max(0, n - k); i++) {
            ans += h[i];
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String args[]) {
        java.util.Scanner sc = new java.util.Scanner(System.in);
        int n = sc.nextInt(), k = sc.nextInt();
        int h[] = new int[n];
        for (int i = 0; i < n; i++) {
            h[i] = sc.nextInt();
        }
        java.util.Arrays.sort(h);
        long ans = 0;
        for (int i = 0; i < Math.max(0, n - k); i++) {
            ans += h[i];
        }
        System.out.println(ans);
    }
} Main
public class Main {
    public static void main(String args[]) {
        java.util.Scanner sc = new java.util.Scanner(System.in);
        int n = sc.nextInt(), k = sc.nextInt();
        int h[] = new int[n];
        for (int i = 0; i < n; i++) {
            h[i] = sc.nextInt();
        }
        java.util.Arrays.sort(h);
        long ans = 0;
        for (int i = 0; i < Math.max(0, n - k); i++) {
            ans += h[i];
        }
        System.out.println(ans);
    }
}