import java.util.*;
public class Main { 
    public static void main(String[] args) {
       Scanner sc=new Scanner(System.in);
       long o=0;
       long n=sc.nextLong();
       long k=sc.nextLong();
       PriorityQueue<Long> pq = new PriorityQueue<>(Collections.reverseOrder());
       for(long i=0;i<n;i++){
           pq.offer(sc.nextLong());
       }
       if(n<=k){
           o=0;
       }else{
            for(long i=0;i<k;i++){
                pq.poll();
            }
            while(pq.size()>0){
                o+=pq.poll();
            }
       }
      System.out.println(o);
    }
} import java.util.*; util.* java public class Main { 
    public static void main(String[] args) {
       Scanner sc=new Scanner(System.in);
       long o=0;
       long n=sc.nextLong();
       long k=sc.nextLong();
       PriorityQueue<Long> pq = new PriorityQueue<>(Collections.reverseOrder());
       for(long i=0;i<n;i++){
           pq.offer(sc.nextLong());
       }
       if(n<=k){
           o=0;
       }else{
            for(long i=0;i<k;i++){
                pq.poll();
            }
            while(pq.size()>0){
                o+=pq.poll();
            }
       }
      System.out.println(o);
    }
} Main public static void main(String[] args) {
       Scanner sc=new Scanner(System.in);
       long o=0;
       long n=sc.nextLong();
       long k=sc.nextLong();
       PriorityQueue<Long> pq = new PriorityQueue<>(Collections.reverseOrder());
       for(long i=0;i<n;i++){
           pq.offer(sc.nextLong());
       }
       if(n<=k){
           o=0;
       }else{
            for(long i=0;i<k;i++){
                pq.poll();
            }
            while(pq.size()>0){
                o+=pq.poll();
            }
       }
      System.out.println(o);
    } main {
       Scanner sc=new Scanner(System.in);
       long o=0;
       long n=sc.nextLong();
       long k=sc.nextLong();
       PriorityQueue<Long> pq = new PriorityQueue<>(Collections.reverseOrder());
       for(long i=0;i<n;i++){
           pq.offer(sc.nextLong());
       }
       if(n<=k){
           o=0;
       }else{
            for(long i=0;i<k;i++){
                pq.poll();
            }
            while(pq.size()>0){
                o+=pq.poll();
            }
       }
      System.out.println(o);
    } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) long o=0; o 0 long n=sc.nextLong(); n sc.nextLong() sc.nextLong sc long k=sc.nextLong(); k sc.nextLong() sc.nextLong sc PriorityQueue<Long> pq = new PriorityQueue<>(Collections.reverseOrder()); pq new PriorityQueue<>(Collections.reverseOrder()) for(long i=0;i<n;i++){
           pq.offer(sc.nextLong());
       } long i=0; long i=0; i 0 i<n i n i++ i++ i {
           pq.offer(sc.nextLong());
       } {
           pq.offer(sc.nextLong());
       } pq.offer(sc.nextLong()) pq.offer pq sc.nextLong() sc.nextLong sc if(n<=k){
           o=0;
       }else{
            for(long i=0;i<k;i++){
                pq.poll();
            }
            while(pq.size()>0){
                o+=pq.poll();
            }
       } n<=k n k {
           o=0;
       } o=0 o 0 {
            for(long i=0;i<k;i++){
                pq.poll();
            }
            while(pq.size()>0){
                o+=pq.poll();
            }
       } for(long i=0;i<k;i++){
                pq.poll();
            } long i=0; long i=0; i 0 i<k i k i++ i++ i {
                pq.poll();
            } {
                pq.poll();
            } pq.poll() pq.poll pq while(pq.size()>0){
                o+=pq.poll();
            } pq.size()>0 pq.size() pq.size pq 0 {
                o+=pq.poll();
            } o+=pq.poll() o pq.poll() pq.poll pq System.out.println(o) System.out.println System.out System System.out o String[] args args public class Main { 
    public static void main(String[] args) {
       Scanner sc=new Scanner(System.in);
       long o=0;
       long n=sc.nextLong();
       long k=sc.nextLong();
       PriorityQueue<Long> pq = new PriorityQueue<>(Collections.reverseOrder());
       for(long i=0;i<n;i++){
           pq.offer(sc.nextLong());
       }
       if(n<=k){
           o=0;
       }else{
            for(long i=0;i<k;i++){
                pq.poll();
            }
            while(pq.size()>0){
                o+=pq.poll();
            }
       }
      System.out.println(o);
    }
} public class Main { 
    public static void main(String[] args) {
       Scanner sc=new Scanner(System.in);
       long o=0;
       long n=sc.nextLong();
       long k=sc.nextLong();
       PriorityQueue<Long> pq = new PriorityQueue<>(Collections.reverseOrder());
       for(long i=0;i<n;i++){
           pq.offer(sc.nextLong());
       }
       if(n<=k){
           o=0;
       }else{
            for(long i=0;i<k;i++){
                pq.poll();
            }
            while(pq.size()>0){
                o+=pq.poll();
            }
       }
      System.out.println(o);
    }
} Main
import java.util.*;
public class Main { 
    public static void main(String[] args) {
       Scanner sc=new Scanner(System.in);
       long o=0;
       long n=sc.nextLong();
       long k=sc.nextLong();
       PriorityQueue<Long> pq = new PriorityQueue<>(Collections.reverseOrder());
       for(long i=0;i<n;i++){
           pq.offer(sc.nextLong());
       }
       if(n<=k){
           o=0;
       }else{
            for(long i=0;i<k;i++){
                pq.poll();
            }
            while(pq.size()>0){
                o+=pq.poll();
            }
       }
      System.out.println(o);
    }
}