import java.util.*; 

class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int k=sc.nextInt();
  		long ans=0;

  		long[] h=new long[n];
		for(int c=0;c<n;c++){
    		h[c]=sc.nextInt();
          	ans+=h[c];
    	}
  		Arrays.sort(h);
  		int c=n-1;
  if(n<=k){
  		ans=0;
  }else{
     while(k>0){
  		ans-=h[c];
       c--;
     k--;
   }
  }		
    	System.out.println(ans);
    }
} import java.util.*; util.* java class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int k=sc.nextInt();
  		long ans=0;

  		long[] h=new long[n];
		for(int c=0;c<n;c++){
    		h[c]=sc.nextInt();
          	ans+=h[c];
    	}
  		Arrays.sort(h);
  		int c=n-1;
  if(n<=k){
  		ans=0;
  }else{
     while(k>0){
  		ans-=h[c];
       c--;
     k--;
   }
  }		
    	System.out.println(ans);
    }
} Main public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int k=sc.nextInt();
  		long ans=0;

  		long[] h=new long[n];
		for(int c=0;c<n;c++){
    		h[c]=sc.nextInt();
          	ans+=h[c];
    	}
  		Arrays.sort(h);
  		int c=n-1;
  if(n<=k){
  		ans=0;
  }else{
     while(k>0){
  		ans-=h[c];
       c--;
     k--;
   }
  }		
    	System.out.println(ans);
    } main {
	Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int k=sc.nextInt();
  		long ans=0;

  		long[] h=new long[n];
		for(int c=0;c<n;c++){
    		h[c]=sc.nextInt();
          	ans+=h[c];
    	}
  		Arrays.sort(h);
  		int c=n-1;
  if(n<=k){
  		ans=0;
  }else{
     while(k>0){
  		ans-=h[c];
       c--;
     k--;
   }
  }		
    	System.out.println(ans);
    } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc int k=sc.nextInt(); k sc.nextInt() sc.nextInt sc long ans=0; ans 0 long[] h=new long[n]; h new long[n] n for(int c=0;c<n;c++){
    		h[c]=sc.nextInt();
          	ans+=h[c];
    	} int c=0; int c=0; c 0 c<n c n c++ c++ c {
    		h[c]=sc.nextInt();
          	ans+=h[c];
    	} {
    		h[c]=sc.nextInt();
          	ans+=h[c];
    	} h[c]=sc.nextInt() h[c] h c sc.nextInt() sc.nextInt sc ans+=h[c] ans h[c] h c Arrays.sort(h) Arrays.sort Arrays h int c=n-1; c n-1 n 1 if(n<=k){
  		ans=0;
  }else{
     while(k>0){
  		ans-=h[c];
       c--;
     k--;
   }
  } n<=k n k {
  		ans=0;
  } ans=0 ans 0 {
     while(k>0){
  		ans-=h[c];
       c--;
     k--;
   }
  } while(k>0){
  		ans-=h[c];
       c--;
     k--;
   } k>0 k 0 {
  		ans-=h[c];
       c--;
     k--;
   } ans-=h[c] ans h[c] h c c-- c k-- k System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*; 

class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int k=sc.nextInt();
  		long ans=0;

  		long[] h=new long[n];
		for(int c=0;c<n;c++){
    		h[c]=sc.nextInt();
          	ans+=h[c];
    	}
  		Arrays.sort(h);
  		int c=n-1;
  if(n<=k){
  		ans=0;
  }else{
     while(k>0){
  		ans-=h[c];
       c--;
     k--;
   }
  }		
    	System.out.println(ans);
    }
}