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

class Main{
    public static void main(String args[])throws IOException{
      try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
        String[] input = br.readLine().split(" ");
        String[] hp_str = br.readLine().split(" ");

        int N = Integer.parseInt(input[0]);
        int K = Integer.parseInt(input[1]);

        int[] hp = new int[N];

        for(int i = 0; i < N; i++){
          hp[i] = Integer.parseInt(hp_str[i]);
        }

        Arrays.sort(hp);
        int tmp = N - 1;
        long result = 0;

        if(K >= N){
          result = 0;
        }else{
          while(K > 0){
            hp[tmp] = -1;
            K--;
            tmp--;
          }

          for(int i = 0; i < N; i++){
            if(hp[i] == -1){
              continue;
            }else{
              result += hp[i];
            }
          }
        }
        
        System.out.println(result);
      }
    }
}
/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