import java.util.*;
import java.io.*;
import java.math.BigInteger;
public class Main {
    public static void main(String[] args) throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();
      String[] split = input.split(" ");
        int n = Integer.parseInt(split[0]);
        int k = Integer.parseInt(split[1]);
      int[] n1 = new int[n];
      String a = br.readLine();
      String[] split1 = a.split(" ");
      BigInteger count =BigInteger.ZERO;
      
      for(int i=0;i<n;i++){
        n1[i]= Integer.parseInt(split1[i]);
      }
       if(n<=k){
    	   System.out.println(count);
      } else {
      Arrays.sort(n1);
     
     for(int x=0;x<n1.length-k;x++){
       count= count.add(BigInteger.valueOf(n1[x]));
     }
     System.out.println(count);
      }
     
         
    
     
    
}
} import java.util.*; util.* java import java.io.*; io.* java import java.math.BigInteger; BigInteger java.math public class Main {
    public static void main(String[] args) throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();
      String[] split = input.split(" ");
        int n = Integer.parseInt(split[0]);
        int k = Integer.parseInt(split[1]);
      int[] n1 = new int[n];
      String a = br.readLine();
      String[] split1 = a.split(" ");
      BigInteger count =BigInteger.ZERO;
      
      for(int i=0;i<n;i++){
        n1[i]= Integer.parseInt(split1[i]);
      }
       if(n<=k){
    	   System.out.println(count);
      } else {
      Arrays.sort(n1);
     
     for(int x=0;x<n1.length-k;x++){
       count= count.add(BigInteger.valueOf(n1[x]));
     }
     System.out.println(count);
      }
     
         
    
     
    
}
} Main public static void main(String[] args) throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();
      String[] split = input.split(" ");
        int n = Integer.parseInt(split[0]);
        int k = Integer.parseInt(split[1]);
      int[] n1 = new int[n];
      String a = br.readLine();
      String[] split1 = a.split(" ");
      BigInteger count =BigInteger.ZERO;
      
      for(int i=0;i<n;i++){
        n1[i]= Integer.parseInt(split1[i]);
      }
       if(n<=k){
    	   System.out.println(count);
      } else {
      Arrays.sort(n1);
     
     for(int x=0;x<n1.length-k;x++){
       count= count.add(BigInteger.valueOf(n1[x]));
     }
     System.out.println(count);
      }
     
         
    
     
    
} main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();
      String[] split = input.split(" ");
        int n = Integer.parseInt(split[0]);
        int k = Integer.parseInt(split[1]);
      int[] n1 = new int[n];
      String a = br.readLine();
      String[] split1 = a.split(" ");
      BigInteger count =BigInteger.ZERO;
      
      for(int i=0;i<n;i++){
        n1[i]= Integer.parseInt(split1[i]);
      }
       if(n<=k){
    	   System.out.println(count);
      } else {
      Arrays.sort(n1);
     
     for(int x=0;x<n1.length-k;x++){
       count= count.add(BigInteger.valueOf(n1[x]));
     }
     System.out.println(count);
      }
     
         
    
     
    
} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String input = br.readLine(); input br.readLine() br.readLine br String[] split = input.split(" "); split input.split(" ") input.split input " " int n = Integer.parseInt(split[0]); n Integer.parseInt(split[0]) Integer.parseInt Integer split[0] split 0 int k = Integer.parseInt(split[1]); k Integer.parseInt(split[1]) Integer.parseInt Integer split[1] split 1 int[] n1 = new int[n]; n1 new int[n] n String a = br.readLine(); a br.readLine() br.readLine br String[] split1 = a.split(" "); split1 a.split(" ") a.split a " " BigInteger count =BigInteger.ZERO; count BigInteger.ZERO BigInteger BigInteger.ZERO for(int i=0;i<n;i++){
        n1[i]= Integer.parseInt(split1[i]);
      } int i=0; int i=0; i 0 i<n i n i++ i++ i {
        n1[i]= Integer.parseInt(split1[i]);
      } {
        n1[i]= Integer.parseInt(split1[i]);
      } n1[i]= Integer.parseInt(split1[i]) n1[i] n1 i Integer.parseInt(split1[i]) Integer.parseInt Integer split1[i] split1 i if(n<=k){
    	   System.out.println(count);
      } else {
      Arrays.sort(n1);
     
     for(int x=0;x<n1.length-k;x++){
       count= count.add(BigInteger.valueOf(n1[x]));
     }
     System.out.println(count);
      } n<=k n k {
    	   System.out.println(count);
      } System.out.println(count) System.out.println System.out System System.out count {
      Arrays.sort(n1);
     
     for(int x=0;x<n1.length-k;x++){
       count= count.add(BigInteger.valueOf(n1[x]));
     }
     System.out.println(count);
      } Arrays.sort(n1) Arrays.sort Arrays n1 for(int x=0;x<n1.length-k;x++){
       count= count.add(BigInteger.valueOf(n1[x]));
     } int x=0; int x=0; x 0 x<n1.length-k x n1.length-k n1.length n1 n1.length k x++ x++ x {
       count= count.add(BigInteger.valueOf(n1[x]));
     } {
       count= count.add(BigInteger.valueOf(n1[x]));
     } count= count.add(BigInteger.valueOf(n1[x])) count count.add(BigInteger.valueOf(n1[x])) count.add count BigInteger.valueOf(n1[x]) BigInteger.valueOf BigInteger n1[x] n1 x System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
    public static void main(String[] args) throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();
      String[] split = input.split(" ");
        int n = Integer.parseInt(split[0]);
        int k = Integer.parseInt(split[1]);
      int[] n1 = new int[n];
      String a = br.readLine();
      String[] split1 = a.split(" ");
      BigInteger count =BigInteger.ZERO;
      
      for(int i=0;i<n;i++){
        n1[i]= Integer.parseInt(split1[i]);
      }
       if(n<=k){
    	   System.out.println(count);
      } else {
      Arrays.sort(n1);
     
     for(int x=0;x<n1.length-k;x++){
       count= count.add(BigInteger.valueOf(n1[x]));
     }
     System.out.println(count);
      }
     
         
    
     
    
}
} public class Main {
    public static void main(String[] args) throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();
      String[] split = input.split(" ");
        int n = Integer.parseInt(split[0]);
        int k = Integer.parseInt(split[1]);
      int[] n1 = new int[n];
      String a = br.readLine();
      String[] split1 = a.split(" ");
      BigInteger count =BigInteger.ZERO;
      
      for(int i=0;i<n;i++){
        n1[i]= Integer.parseInt(split1[i]);
      }
       if(n<=k){
    	   System.out.println(count);
      } else {
      Arrays.sort(n1);
     
     for(int x=0;x<n1.length-k;x++){
       count= count.add(BigInteger.valueOf(n1[x]));
     }
     System.out.println(count);
      }
     
         
    
     
    
}
} Main
import java.util.*;
import java.io.*;
import java.math.BigInteger;
public class Main {
    public static void main(String[] args) throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();
      String[] split = input.split(" ");
        int n = Integer.parseInt(split[0]);
        int k = Integer.parseInt(split[1]);
      int[] n1 = new int[n];
      String a = br.readLine();
      String[] split1 = a.split(" ");
      BigInteger count =BigInteger.ZERO;
      
      for(int i=0;i<n;i++){
        n1[i]= Integer.parseInt(split1[i]);
      }
       if(n<=k){
    	   System.out.println(count);
      } else {
      Arrays.sort(n1);
     
     for(int x=0;x<n1.length-k;x++){
       count= count.add(BigInteger.valueOf(n1[x]));
     }
     System.out.println(count);
      }
     
         
    
     
    
}
}
