import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner( System.in );

        int varN   = Integer.parseInt(scan.next());
        int kill   = Integer.parseInt(scan.next());
        Integer[] health = new Integer[varN];

        for(int i=0; i<varN; i++){
            health[i] = Integer.parseInt(scan.next());
        }

        if(varN <= kill){
            System.out.println(0);
        }else{
            Arrays.sort(health, Comparator.reverseOrder() );

            long attack = 0;
            for(int i=kill; i<varN; i++){
                attack += health[i];
            }
            System.out.println(attack);
        }

    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner( System.in );

        int varN   = Integer.parseInt(scan.next());
        int kill   = Integer.parseInt(scan.next());
        Integer[] health = new Integer[varN];

        for(int i=0; i<varN; i++){
            health[i] = Integer.parseInt(scan.next());
        }

        if(varN <= kill){
            System.out.println(0);
        }else{
            Arrays.sort(health, Comparator.reverseOrder() );

            long attack = 0;
            for(int i=kill; i<varN; i++){
                attack += health[i];
            }
            System.out.println(attack);
        }

    }
} Main public static void main(String[] args){
        Scanner scan = new Scanner( System.in );

        int varN   = Integer.parseInt(scan.next());
        int kill   = Integer.parseInt(scan.next());
        Integer[] health = new Integer[varN];

        for(int i=0; i<varN; i++){
            health[i] = Integer.parseInt(scan.next());
        }

        if(varN <= kill){
            System.out.println(0);
        }else{
            Arrays.sort(health, Comparator.reverseOrder() );

            long attack = 0;
            for(int i=kill; i<varN; i++){
                attack += health[i];
            }
            System.out.println(attack);
        }

    } main {
        Scanner scan = new Scanner( System.in );

        int varN   = Integer.parseInt(scan.next());
        int kill   = Integer.parseInt(scan.next());
        Integer[] health = new Integer[varN];

        for(int i=0; i<varN; i++){
            health[i] = Integer.parseInt(scan.next());
        }

        if(varN <= kill){
            System.out.println(0);
        }else{
            Arrays.sort(health, Comparator.reverseOrder() );

            long attack = 0;
            for(int i=kill; i<varN; i++){
                attack += health[i];
            }
            System.out.println(attack);
        }

    } Scanner scan = new Scanner( System.in ); scan new Scanner( System.in ) int varN   = Integer.parseInt(scan.next()); varN Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan int kill   = Integer.parseInt(scan.next()); kill Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan Integer[] health = new Integer[varN]; health new Integer[varN] varN for(int i=0; i<varN; i++){
            health[i] = Integer.parseInt(scan.next());
        } int i=0; int i=0; i 0 i<varN i varN i++ i++ i {
            health[i] = Integer.parseInt(scan.next());
        } {
            health[i] = Integer.parseInt(scan.next());
        } health[i] = Integer.parseInt(scan.next()) health[i] health i Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan if(varN <= kill){
            System.out.println(0);
        }else{
            Arrays.sort(health, Comparator.reverseOrder() );

            long attack = 0;
            for(int i=kill; i<varN; i++){
                attack += health[i];
            }
            System.out.println(attack);
        } varN <= kill varN kill {
            System.out.println(0);
        } System.out.println(0) System.out.println System.out System System.out 0 {
            Arrays.sort(health, Comparator.reverseOrder() );

            long attack = 0;
            for(int i=kill; i<varN; i++){
                attack += health[i];
            }
            System.out.println(attack);
        } Arrays.sort(health, Comparator.reverseOrder() ) Arrays.sort Arrays health Comparator.reverseOrder() Comparator.reverseOrder Comparator long attack = 0; attack 0 for(int i=kill; i<varN; i++){
                attack += health[i];
            } int i=kill; int i=kill; i kill i<varN i varN i++ i++ i {
                attack += health[i];
            } {
                attack += health[i];
            } attack += health[i] attack health[i] health i System.out.println(attack) System.out.println System.out System System.out attack String[] args args public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner( System.in );

        int varN   = Integer.parseInt(scan.next());
        int kill   = Integer.parseInt(scan.next());
        Integer[] health = new Integer[varN];

        for(int i=0; i<varN; i++){
            health[i] = Integer.parseInt(scan.next());
        }

        if(varN <= kill){
            System.out.println(0);
        }else{
            Arrays.sort(health, Comparator.reverseOrder() );

            long attack = 0;
            for(int i=kill; i<varN; i++){
                attack += health[i];
            }
            System.out.println(attack);
        }

    }
} public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner( System.in );

        int varN   = Integer.parseInt(scan.next());
        int kill   = Integer.parseInt(scan.next());
        Integer[] health = new Integer[varN];

        for(int i=0; i<varN; i++){
            health[i] = Integer.parseInt(scan.next());
        }

        if(varN <= kill){
            System.out.println(0);
        }else{
            Arrays.sort(health, Comparator.reverseOrder() );

            long attack = 0;
            for(int i=kill; i<varN; i++){
                attack += health[i];
            }
            System.out.println(attack);
        }

    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner( System.in );

        int varN   = Integer.parseInt(scan.next());
        int kill   = Integer.parseInt(scan.next());
        Integer[] health = new Integer[varN];

        for(int i=0; i<varN; i++){
            health[i] = Integer.parseInt(scan.next());
        }

        if(varN <= kill){
            System.out.println(0);
        }else{
            Arrays.sort(health, Comparator.reverseOrder() );

            long attack = 0;
            for(int i=kill; i<varN; i++){
                attack += health[i];
            }
            System.out.println(attack);
        }

    }
}