import java.math.BigInteger;
import java.util.*;


class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        int K = sc.nextInt();
        sc.nextLine();

        Long[] list = new Long[N];
        for (int i = 0; i < N; i++) {
            list[i] = sc.nextLong();
        }

        Arrays.sort(list, Collections.reverseOrder());

        BigInteger ans = new BigInteger("0");
        for (int i = K; i < N; i++) {
            ans = ans.add(new BigInteger(list[i].toString()));
        }

        System.out.println(ans);
    }

    static double pre (int x) {
        return ((double)x + 1) / 2;
    }
} import java.math.BigInteger; BigInteger java.math import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        int K = sc.nextInt();
        sc.nextLine();

        Long[] list = new Long[N];
        for (int i = 0; i < N; i++) {
            list[i] = sc.nextLong();
        }

        Arrays.sort(list, Collections.reverseOrder());

        BigInteger ans = new BigInteger("0");
        for (int i = K; i < N; i++) {
            ans = ans.add(new BigInteger(list[i].toString()));
        }

        System.out.println(ans);
    }

    static double pre (int x) {
        return ((double)x + 1) / 2;
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        int K = sc.nextInt();
        sc.nextLine();

        Long[] list = new Long[N];
        for (int i = 0; i < N; i++) {
            list[i] = sc.nextLong();
        }

        Arrays.sort(list, Collections.reverseOrder());

        BigInteger ans = new BigInteger("0");
        for (int i = K; i < N; i++) {
            ans = ans.add(new BigInteger(list[i].toString()));
        }

        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        int K = sc.nextInt();
        sc.nextLine();

        Long[] list = new Long[N];
        for (int i = 0; i < N; i++) {
            list[i] = sc.nextLong();
        }

        Arrays.sort(list, Collections.reverseOrder());

        BigInteger ans = new BigInteger("0");
        for (int i = K; i < N; i++) {
            ans = ans.add(new BigInteger(list[i].toString()));
        }

        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 sc.nextLine() sc.nextLine sc Long[] list = new Long[N]; list new Long[N] N for (int i = 0; i < N; i++) {
            list[i] = sc.nextLong();
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            list[i] = sc.nextLong();
        } {
            list[i] = sc.nextLong();
        } list[i] = sc.nextLong() list[i] list i sc.nextLong() sc.nextLong sc Arrays.sort(list, Collections.reverseOrder()) Arrays.sort Arrays list Collections.reverseOrder() Collections.reverseOrder Collections BigInteger ans = new BigInteger("0"); ans new BigInteger("0") for (int i = K; i < N; i++) {
            ans = ans.add(new BigInteger(list[i].toString()));
        } int i = K; int i = K; i K i < N i N i++ i++ i {
            ans = ans.add(new BigInteger(list[i].toString()));
        } {
            ans = ans.add(new BigInteger(list[i].toString()));
        } ans = ans.add(new BigInteger(list[i].toString())) ans ans.add(new BigInteger(list[i].toString())) ans.add ans new BigInteger(list[i].toString()) System.out.println(ans) System.out.println System.out System System.out ans String[] args args static double pre (int x) {
        return ((double)x + 1) / 2;
    } pre {
        return ((double)x + 1) / 2;
    } return ((double)x + 1) / 2; ((double)x + 1) / 2 ((double)x + 1) (double)x 1 2 int x x
import java.math.BigInteger;
import java.util.*;


class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        int K = sc.nextInt();
        sc.nextLine();

        Long[] list = new Long[N];
        for (int i = 0; i < N; i++) {
            list[i] = sc.nextLong();
        }

        Arrays.sort(list, Collections.reverseOrder());

        BigInteger ans = new BigInteger("0");
        for (int i = K; i < N; i++) {
            ans = ans.add(new BigInteger(list[i].toString()));
        }

        System.out.println(ans);
    }

    static double pre (int x) {
        return ((double)x + 1) / 2;
    }
}