import java.io.*;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) throws IOException {
        init();
        int n = nextInt(), k = nextInt();

        ArrayList<Long> h = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            h.add(nextLong());
        }

        h.sort(Comparator.reverseOrder());
        long ans = 0;
        for (int i = k; i < n; i++) {
            ans += h.get(i);
        }

        System.out.println(ans);
    }

    //Input Reader
    private static BufferedReader reader;
    private static StringTokenizer tokenizer;

    private static void init() {
        reader = new BufferedReader(new InputStreamReader(System.in));
        tokenizer = new StringTokenizer("");
    }

    private static String next() throws IOException {
        String read;
        while (!tokenizer.hasMoreTokens()) {
            read = reader.readLine();
            if (read == null || read.equals(""))
                return "-1";
            tokenizer = new StringTokenizer(read);
        }

        return tokenizer.nextToken();
    }

    private static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    private static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
} import java.io.*; io.* java import java.util.ArrayList; ArrayList java.util import java.util.Comparator; Comparator java.util import java.util.StringTokenizer; StringTokenizer java.util public class Main {

    public static void main(String[] args) throws IOException {
        init();
        int n = nextInt(), k = nextInt();

        ArrayList<Long> h = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            h.add(nextLong());
        }

        h.sort(Comparator.reverseOrder());
        long ans = 0;
        for (int i = k; i < n; i++) {
            ans += h.get(i);
        }

        System.out.println(ans);
    }

    //Input Reader
    private static BufferedReader reader;
    private static StringTokenizer tokenizer;

    private static void init() {
        reader = new BufferedReader(new InputStreamReader(System.in));
        tokenizer = new StringTokenizer("");
    }

    private static String next() throws IOException {
        String read;
        while (!tokenizer.hasMoreTokens()) {
            read = reader.readLine();
            if (read == null || read.equals(""))
                return "-1";
            tokenizer = new StringTokenizer(read);
        }

        return tokenizer.nextToken();
    }

    private static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    private static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
} Main //Input Reader
    private static BufferedReader reader; reader private static StringTokenizer tokenizer; tokenizer public static void main(String[] args) throws IOException {
        init();
        int n = nextInt(), k = nextInt();

        ArrayList<Long> h = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            h.add(nextLong());
        }

        h.sort(Comparator.reverseOrder());
        long ans = 0;
        for (int i = k; i < n; i++) {
            ans += h.get(i);
        }

        System.out.println(ans);
    } main {
        init();
        int n = nextInt(), k = nextInt();

        ArrayList<Long> h = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            h.add(nextLong());
        }

        h.sort(Comparator.reverseOrder());
        long ans = 0;
        for (int i = k; i < n; i++) {
            ans += h.get(i);
        }

        System.out.println(ans);
    } init() init int n = nextInt() n nextInt() nextInt k = nextInt(); k nextInt() nextInt ArrayList<Long> h = new ArrayList<>(); h new ArrayList<>() for (int i = 0; i < n; i++) {
            h.add(nextLong());
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            h.add(nextLong());
        } {
            h.add(nextLong());
        } h.add(nextLong()) h.add h nextLong() nextLong h.sort(Comparator.reverseOrder()) h.sort h Comparator.reverseOrder() Comparator.reverseOrder Comparator long ans = 0; ans 0 for (int i = k; i < n; i++) {
            ans += h.get(i);
        } int i = k; int i = k; i k i < n i n i++ i++ i {
            ans += h.get(i);
        } {
            ans += h.get(i);
        } ans += h.get(i) ans h.get(i) h.get h i System.out.println(ans) System.out.println System.out System System.out ans String[] args args private static void init() {
        reader = new BufferedReader(new InputStreamReader(System.in));
        tokenizer = new StringTokenizer("");
    } init {
        reader = new BufferedReader(new InputStreamReader(System.in));
        tokenizer = new StringTokenizer("");
    } reader = new BufferedReader(new InputStreamReader(System.in)) reader new BufferedReader(new InputStreamReader(System.in)) tokenizer = new StringTokenizer("") tokenizer new StringTokenizer("") private static String next() throws IOException {
        String read;
        while (!tokenizer.hasMoreTokens()) {
            read = reader.readLine();
            if (read == null || read.equals(""))
                return "-1";
            tokenizer = new StringTokenizer(read);
        }

        return tokenizer.nextToken();
    } next {
        String read;
        while (!tokenizer.hasMoreTokens()) {
            read = reader.readLine();
            if (read == null || read.equals(""))
                return "-1";
            tokenizer = new StringTokenizer(read);
        }

        return tokenizer.nextToken();
    } String read; read while (!tokenizer.hasMoreTokens()) {
            read = reader.readLine();
            if (read == null || read.equals(""))
                return "-1";
            tokenizer = new StringTokenizer(read);
        } !tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
            read = reader.readLine();
            if (read == null || read.equals(""))
                return "-1";
            tokenizer = new StringTokenizer(read);
        } read = reader.readLine() read reader.readLine() reader.readLine reader if (read == null || read.equals(""))
                return "-1"; read == null || read.equals("") read == null read null read.equals("") read.equals read "" return "-1"; "-1" tokenizer = new StringTokenizer(read) tokenizer new StringTokenizer(read) return tokenizer.nextToken(); tokenizer.nextToken() tokenizer.nextToken tokenizer private static int nextInt() throws IOException {
        return Integer.parseInt(next());
    } nextInt {
        return Integer.parseInt(next());
    } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next private static long nextLong() throws IOException {
        return Long.parseLong(next());
    } nextLong {
        return Long.parseLong(next());
    } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public class Main {

    public static void main(String[] args) throws IOException {
        init();
        int n = nextInt(), k = nextInt();

        ArrayList<Long> h = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            h.add(nextLong());
        }

        h.sort(Comparator.reverseOrder());
        long ans = 0;
        for (int i = k; i < n; i++) {
            ans += h.get(i);
        }

        System.out.println(ans);
    }

    //Input Reader
    private static BufferedReader reader;
    private static StringTokenizer tokenizer;

    private static void init() {
        reader = new BufferedReader(new InputStreamReader(System.in));
        tokenizer = new StringTokenizer("");
    }

    private static String next() throws IOException {
        String read;
        while (!tokenizer.hasMoreTokens()) {
            read = reader.readLine();
            if (read == null || read.equals(""))
                return "-1";
            tokenizer = new StringTokenizer(read);
        }

        return tokenizer.nextToken();
    }

    private static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    private static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
} public class Main {

    public static void main(String[] args) throws IOException {
        init();
        int n = nextInt(), k = nextInt();

        ArrayList<Long> h = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            h.add(nextLong());
        }

        h.sort(Comparator.reverseOrder());
        long ans = 0;
        for (int i = k; i < n; i++) {
            ans += h.get(i);
        }

        System.out.println(ans);
    }

    //Input Reader
    private static BufferedReader reader;
    private static StringTokenizer tokenizer;

    private static void init() {
        reader = new BufferedReader(new InputStreamReader(System.in));
        tokenizer = new StringTokenizer("");
    }

    private static String next() throws IOException {
        String read;
        while (!tokenizer.hasMoreTokens()) {
            read = reader.readLine();
            if (read == null || read.equals(""))
                return "-1";
            tokenizer = new StringTokenizer(read);
        }

        return tokenizer.nextToken();
    }

    private static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    private static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
} Main
import java.io.*;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) throws IOException {
        init();
        int n = nextInt(), k = nextInt();

        ArrayList<Long> h = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            h.add(nextLong());
        }

        h.sort(Comparator.reverseOrder());
        long ans = 0;
        for (int i = k; i < n; i++) {
            ans += h.get(i);
        }

        System.out.println(ans);
    }

    //Input Reader
    private static BufferedReader reader;
    private static StringTokenizer tokenizer;

    private static void init() {
        reader = new BufferedReader(new InputStreamReader(System.in));
        tokenizer = new StringTokenizer("");
    }

    private static String next() throws IOException {
        String read;
        while (!tokenizer.hasMoreTokens()) {
            read = reader.readLine();
            if (read == null || read.equals(""))
                return "-1";
            tokenizer = new StringTokenizer(read);
        }

        return tokenizer.nextToken();
    }

    private static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    private static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
}