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);
    }
}


/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz