import java.io.*;
import java.util.*;

public class Main {

    static BufferedReader br;
    static StringTokenizer st;

    public static void main(final String[] args) throws Exception {
        br = new BufferedReader(new InputStreamReader(System.in));
        long N;
        N = readLong();
        long K;
        K = readLong();
        List<Long> H = new ArrayList<>();
        for(int i = 0 ; i < N ; i++){
                H.add(readLong());
        }

        final Solver solver = new Solver();
        solver.solve(N, K, H);
    }

    static String next() throws IOException {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine().trim());
        return st.nextToken();
    }

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

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

class Solver {
    public void solve(long N, long K, List<Long> H) {
        H.sort(Collections.reverseOrder());

        long ans = 0;
        for (int i = (int) K; i < N; i++) {
            ans += H.get(i);
        }
        System.out.println(ans);
    }
}
 import java.io.*; io.* java import java.util.*; util.* java public class Main {

    static BufferedReader br;
    static StringTokenizer st;

    public static void main(final String[] args) throws Exception {
        br = new BufferedReader(new InputStreamReader(System.in));
        long N;
        N = readLong();
        long K;
        K = readLong();
        List<Long> H = new ArrayList<>();
        for(int i = 0 ; i < N ; i++){
                H.add(readLong());
        }

        final Solver solver = new Solver();
        solver.solve(N, K, H);
    }

    static String next() throws IOException {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine().trim());
        return st.nextToken();
    }

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

    static int readInt() throws IOException {
        return Integer.parseInt(next());
    }
} Main static BufferedReader br; br static StringTokenizer st; st public static void main(final String[] args) throws Exception {
        br = new BufferedReader(new InputStreamReader(System.in));
        long N;
        N = readLong();
        long K;
        K = readLong();
        List<Long> H = new ArrayList<>();
        for(int i = 0 ; i < N ; i++){
                H.add(readLong());
        }

        final Solver solver = new Solver();
        solver.solve(N, K, H);
    } main {
        br = new BufferedReader(new InputStreamReader(System.in));
        long N;
        N = readLong();
        long K;
        K = readLong();
        List<Long> H = new ArrayList<>();
        for(int i = 0 ; i < N ; i++){
                H.add(readLong());
        }

        final Solver solver = new Solver();
        solver.solve(N, K, H);
    } br = new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) long N; N N = readLong() N readLong() readLong long K; K K = readLong() K readLong() readLong List<Long> H = new ArrayList<>(); H new ArrayList<>() for(int i = 0 ; i < N ; i++){
                H.add(readLong());
        } int i = 0 ; int i = 0 ; i 0 i < N i N i++ i++ i {
                H.add(readLong());
        } {
                H.add(readLong());
        } H.add(readLong()) H.add H readLong() readLong final Solver solver = new Solver(); solver new Solver() solver.solve(N, K, H) solver.solve solver N K H final String[] args args static String next() throws IOException {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine().trim());
        return st.nextToken();
    } next {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine().trim());
        return st.nextToken();
    } while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine().trim()); st == null || !st.hasMoreTokens() st == null st null !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st st = new StringTokenizer(br.readLine().trim()) st new StringTokenizer(br.readLine().trim()) return st.nextToken(); st.nextToken() st.nextToken st static long readLong() throws IOException {
        return Long.parseLong(next());
    } readLong {
        return Long.parseLong(next());
    } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next static int readInt() throws IOException {
        return Integer.parseInt(next());
    } readInt {
        return Integer.parseInt(next());
    } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next class Solver {
    public void solve(long N, long K, List<Long> H) {
        H.sort(Collections.reverseOrder());

        long ans = 0;
        for (int i = (int) K; i < N; i++) {
            ans += H.get(i);
        }
        System.out.println(ans);
    }
} Solver public void solve(long N, long K, List<Long> H) {
        H.sort(Collections.reverseOrder());

        long ans = 0;
        for (int i = (int) K; i < N; i++) {
            ans += H.get(i);
        }
        System.out.println(ans);
    } solve {
        H.sort(Collections.reverseOrder());

        long ans = 0;
        for (int i = (int) K; i < N; i++) {
            ans += H.get(i);
        }
        System.out.println(ans);
    } H.sort(Collections.reverseOrder()) H.sort H Collections.reverseOrder() Collections.reverseOrder Collections long ans = 0; ans 0 for (int i = (int) K; i < N; i++) {
            ans += H.get(i);
        } int i = (int) K; int i = (int) K; i (int) 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 long N N long K K List<Long> H H public class Main {

    static BufferedReader br;
    static StringTokenizer st;

    public static void main(final String[] args) throws Exception {
        br = new BufferedReader(new InputStreamReader(System.in));
        long N;
        N = readLong();
        long K;
        K = readLong();
        List<Long> H = new ArrayList<>();
        for(int i = 0 ; i < N ; i++){
                H.add(readLong());
        }

        final Solver solver = new Solver();
        solver.solve(N, K, H);
    }

    static String next() throws IOException {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine().trim());
        return st.nextToken();
    }

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

    static int readInt() throws IOException {
        return Integer.parseInt(next());
    }
} public class Main {

    static BufferedReader br;
    static StringTokenizer st;

    public static void main(final String[] args) throws Exception {
        br = new BufferedReader(new InputStreamReader(System.in));
        long N;
        N = readLong();
        long K;
        K = readLong();
        List<Long> H = new ArrayList<>();
        for(int i = 0 ; i < N ; i++){
                H.add(readLong());
        }

        final Solver solver = new Solver();
        solver.solve(N, K, H);
    }

    static String next() throws IOException {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine().trim());
        return st.nextToken();
    }

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

    static int readInt() throws IOException {
        return Integer.parseInt(next());
    }
} Main
import java.io.*;
import java.util.*;

public class Main {

    static BufferedReader br;
    static StringTokenizer st;

    public static void main(final String[] args) throws Exception {
        br = new BufferedReader(new InputStreamReader(System.in));
        long N;
        N = readLong();
        long K;
        K = readLong();
        List<Long> H = new ArrayList<>();
        for(int i = 0 ; i < N ; i++){
                H.add(readLong());
        }

        final Solver solver = new Solver();
        solver.solve(N, K, H);
    }

    static String next() throws IOException {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine().trim());
        return st.nextToken();
    }

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

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

class Solver {
    public void solve(long N, long K, List<Long> H) {
        H.sort(Collections.reverseOrder());

        long ans = 0;
        for (int i = (int) K; i < N; i++) {
            ans += H.get(i);
        }
        System.out.println(ans);
    }
}

