//package com.company;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), k = sc.nextInt();
        ArrayList<Integer> a = new ArrayList<>(n);
        for (int i = 0; i < n; i++)
        {
            int val = sc.nextInt();
            a.add(val);
        }
        Collections.sort(a, Collections.reverseOrder());
        long ans = 0;
        for (int i = k; i < n; i++)
            ans += a.get(i);
        System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), k = sc.nextInt();
        ArrayList<Integer> a = new ArrayList<>(n);
        for (int i = 0; i < n; i++)
        {
            int val = sc.nextInt();
            a.add(val);
        }
        Collections.sort(a, Collections.reverseOrder());
        long ans = 0;
        for (int i = k; i < n; i++)
            ans += a.get(i);
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), k = sc.nextInt();
        ArrayList<Integer> a = new ArrayList<>(n);
        for (int i = 0; i < n; i++)
        {
            int val = sc.nextInt();
            a.add(val);
        }
        Collections.sort(a, Collections.reverseOrder());
        long ans = 0;
        for (int i = k; i < n; i++)
            ans += a.get(i);
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), k = sc.nextInt();
        ArrayList<Integer> a = new ArrayList<>(n);
        for (int i = 0; i < n; i++)
        {
            int val = sc.nextInt();
            a.add(val);
        }
        Collections.sort(a, Collections.reverseOrder());
        long ans = 0;
        for (int i = k; i < n; i++)
            ans += a.get(i);
        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 k = sc.nextInt(); k sc.nextInt() sc.nextInt sc ArrayList<Integer> a = new ArrayList<>(n); a new ArrayList<>(n) for (int i = 0; i < n; i++)
        {
            int val = sc.nextInt();
            a.add(val);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            int val = sc.nextInt();
            a.add(val);
        } {
            int val = sc.nextInt();
            a.add(val);
        } int val = sc.nextInt(); val sc.nextInt() sc.nextInt sc a.add(val) a.add a val Collections.sort(a, Collections.reverseOrder()) Collections.sort Collections a Collections.reverseOrder() Collections.reverseOrder Collections long ans = 0; ans 0 for (int i = k; i < n; i++)
            ans += a.get(i); int i = k; int i = k; i k i < n i n i++ i++ i ans += a.get(i); ans += a.get(i) ans a.get(i) a.get a 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) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), k = sc.nextInt();
        ArrayList<Integer> a = new ArrayList<>(n);
        for (int i = 0; i < n; i++)
        {
            int val = sc.nextInt();
            a.add(val);
        }
        Collections.sort(a, Collections.reverseOrder());
        long ans = 0;
        for (int i = k; i < n; i++)
            ans += a.get(i);
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), k = sc.nextInt();
        ArrayList<Integer> a = new ArrayList<>(n);
        for (int i = 0; i < n; i++)
        {
            int val = sc.nextInt();
            a.add(val);
        }
        Collections.sort(a, Collections.reverseOrder());
        long ans = 0;
        for (int i = k; i < n; i++)
            ans += a.get(i);
        System.out.println(ans);
    }
} Main
//package com.company;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), k = sc.nextInt();
        ArrayList<Integer> a = new ArrayList<>(n);
        for (int i = 0; i < n; i++)
        {
            int val = sc.nextInt();
            a.add(val);
        }
        Collections.sort(a, Collections.reverseOrder());
        long ans = 0;
        for (int i = k; i < n; i++)
            ans += a.get(i);
        System.out.println(ans);
    }
}
