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);
      }
    }
} import java.util.*; util.* java import java.io.*; io.* java 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);
      }
    }
} 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);
      }
    } main {
      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);
      }
    } 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);
      } {
        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);
      } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) String[] input = br.readLine().split(" "); input br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " String[] hp_str = br.readLine().split(" "); hp_str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int N = Integer.parseInt(input[0]); N Integer.parseInt(input[0]) Integer.parseInt Integer input[0] input 0 int K = Integer.parseInt(input[1]); K Integer.parseInt(input[1]) Integer.parseInt Integer input[1] input 1 int[] hp = new int[N]; hp new int[N] N for(int i = 0; i < N; i++){
          hp[i] = Integer.parseInt(hp_str[i]);
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
          hp[i] = Integer.parseInt(hp_str[i]);
        } {
          hp[i] = Integer.parseInt(hp_str[i]);
        } hp[i] = Integer.parseInt(hp_str[i]) hp[i] hp i Integer.parseInt(hp_str[i]) Integer.parseInt Integer hp_str[i] hp_str i Arrays.sort(hp) Arrays.sort Arrays hp int tmp = N - 1; tmp N - 1 N 1 long result = 0; 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];
            }
          }
        } K >= N K N {
          result = 0;
        } result = 0 result 0 {
          while(K > 0){
            hp[tmp] = -1;
            K--;
            tmp--;
          }

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