import java.util.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Collections;

public class Main {
	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        //ArrayList<Integer> list;
        List<Integer> list = new ArrayList<>();
        
        int number = sc.nextInt();
        int k = sc.nextInt(); 
        for(int i = 0; i < number ; i++){
            list.add(sc.nextInt());
        }

        Collections.sort(list);
        int min = number - k;
        long count = 0;
        if( min <= 0 ){
            System.out.println(count);
        }else{
            for(int i = 0; i<min; i++){
                count += list.get(i);
            }
            System.out.println(count);
        }
    
	}
} import java.util.*; util.* java import java.util.ArrayList; ArrayList java.util import java.util.Iterator; Iterator java.util import java.util.List; List java.util import java.util.Collections; Collections java.util public class Main {
	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        //ArrayList<Integer> list;
        List<Integer> list = new ArrayList<>();
        
        int number = sc.nextInt();
        int k = sc.nextInt(); 
        for(int i = 0; i < number ; i++){
            list.add(sc.nextInt());
        }

        Collections.sort(list);
        int min = number - k;
        long count = 0;
        if( min <= 0 ){
            System.out.println(count);
        }else{
            for(int i = 0; i<min; i++){
                count += list.get(i);
            }
            System.out.println(count);
        }
    
	}
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        //ArrayList<Integer> list;
        List<Integer> list = new ArrayList<>();
        
        int number = sc.nextInt();
        int k = sc.nextInt(); 
        for(int i = 0; i < number ; i++){
            list.add(sc.nextInt());
        }

        Collections.sort(list);
        int min = number - k;
        long count = 0;
        if( min <= 0 ){
            System.out.println(count);
        }else{
            for(int i = 0; i<min; i++){
                count += list.get(i);
            }
            System.out.println(count);
        }
    
	} main {
        Scanner sc = new Scanner(System.in);
        //ArrayList<Integer> list;
        List<Integer> list = new ArrayList<>();
        
        int number = sc.nextInt();
        int k = sc.nextInt(); 
        for(int i = 0; i < number ; i++){
            list.add(sc.nextInt());
        }

        Collections.sort(list);
        int min = number - k;
        long count = 0;
        if( min <= 0 ){
            System.out.println(count);
        }else{
            for(int i = 0; i<min; i++){
                count += list.get(i);
            }
            System.out.println(count);
        }
    
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) List<Integer> list = new ArrayList<>(); list new ArrayList<>() int number = sc.nextInt(); number sc.nextInt() sc.nextInt sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc for(int i = 0; i < number ; i++){
            list.add(sc.nextInt());
        } int i = 0; int i = 0; i 0 i < number i number i++ i++ i {
            list.add(sc.nextInt());
        } {
            list.add(sc.nextInt());
        } list.add(sc.nextInt()) list.add list sc.nextInt() sc.nextInt sc Collections.sort(list) Collections.sort Collections list int min = number - k; min number - k number k long count = 0; count 0 if( min <= 0 ){
            System.out.println(count);
        }else{
            for(int i = 0; i<min; i++){
                count += list.get(i);
            }
            System.out.println(count);
        } min <= 0 min 0 {
            System.out.println(count);
        } System.out.println(count) System.out.println System.out System System.out count {
            for(int i = 0; i<min; i++){
                count += list.get(i);
            }
            System.out.println(count);
        } for(int i = 0; i<min; i++){
                count += list.get(i);
            } int i = 0; int i = 0; i 0 i<min i min i++ i++ i {
                count += list.get(i);
            } {
                count += list.get(i);
            } count += list.get(i) count list.get(i) list.get list i 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){
        Scanner sc = new Scanner(System.in);
        //ArrayList<Integer> list;
        List<Integer> list = new ArrayList<>();
        
        int number = sc.nextInt();
        int k = sc.nextInt(); 
        for(int i = 0; i < number ; i++){
            list.add(sc.nextInt());
        }

        Collections.sort(list);
        int min = number - k;
        long count = 0;
        if( min <= 0 ){
            System.out.println(count);
        }else{
            for(int i = 0; i<min; i++){
                count += list.get(i);
            }
            System.out.println(count);
        }
    
	}
} public class Main {
	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        //ArrayList<Integer> list;
        List<Integer> list = new ArrayList<>();
        
        int number = sc.nextInt();
        int k = sc.nextInt(); 
        for(int i = 0; i < number ; i++){
            list.add(sc.nextInt());
        }

        Collections.sort(list);
        int min = number - k;
        long count = 0;
        if( min <= 0 ){
            System.out.println(count);
        }else{
            for(int i = 0; i<min; i++){
                count += list.get(i);
            }
            System.out.println(count);
        }
    
	}
} Main
import java.util.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Collections;

public class Main {
	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        //ArrayList<Integer> list;
        List<Integer> list = new ArrayList<>();
        
        int number = sc.nextInt();
        int k = sc.nextInt(); 
        for(int i = 0; i < number ; i++){
            list.add(sc.nextInt());
        }

        Collections.sort(list);
        int min = number - k;
        long count = 0;
        if( min <= 0 ){
            System.out.println(count);
        }else{
            for(int i = 0; i<min; i++){
                count += list.get(i);
            }
            System.out.println(count);
        }
    
	}
}