import java.util.*;

public class Main {
    public static void main(String[] args) {
        int N;
        int K;
        int[] Hi = null;
        try (Scanner sc = new Scanner(System.in)) {
            N = sc.nextInt();
            K = sc.nextInt();
            Hi = new int[N];
            for (int i = 0; i < N; i++) {
                Hi[i] = sc.nextInt();
            }
        }
        Arrays.sort(Hi);
        if(K > 0){
            if(K > Hi.length){
                K = Hi.length;
            }
            Arrays.fill(Hi,Hi.length-K,Hi.length ,0);
        }
        long result = 0;
        for(int attack : Hi){
            result += attack;
        }
        System.out.println(result);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        int N;
        int K;
        int[] Hi = null;
        try (Scanner sc = new Scanner(System.in)) {
            N = sc.nextInt();
            K = sc.nextInt();
            Hi = new int[N];
            for (int i = 0; i < N; i++) {
                Hi[i] = sc.nextInt();
            }
        }
        Arrays.sort(Hi);
        if(K > 0){
            if(K > Hi.length){
                K = Hi.length;
            }
            Arrays.fill(Hi,Hi.length-K,Hi.length ,0);
        }
        long result = 0;
        for(int attack : Hi){
            result += attack;
        }
        System.out.println(result);
    }
} Main public static void main(String[] args) {
        int N;
        int K;
        int[] Hi = null;
        try (Scanner sc = new Scanner(System.in)) {
            N = sc.nextInt();
            K = sc.nextInt();
            Hi = new int[N];
            for (int i = 0; i < N; i++) {
                Hi[i] = sc.nextInt();
            }
        }
        Arrays.sort(Hi);
        if(K > 0){
            if(K > Hi.length){
                K = Hi.length;
            }
            Arrays.fill(Hi,Hi.length-K,Hi.length ,0);
        }
        long result = 0;
        for(int attack : Hi){
            result += attack;
        }
        System.out.println(result);
    } main {
        int N;
        int K;
        int[] Hi = null;
        try (Scanner sc = new Scanner(System.in)) {
            N = sc.nextInt();
            K = sc.nextInt();
            Hi = new int[N];
            for (int i = 0; i < N; i++) {
                Hi[i] = sc.nextInt();
            }
        }
        Arrays.sort(Hi);
        if(K > 0){
            if(K > Hi.length){
                K = Hi.length;
            }
            Arrays.fill(Hi,Hi.length-K,Hi.length ,0);
        }
        long result = 0;
        for(int attack : Hi){
            result += attack;
        }
        System.out.println(result);
    } int N; N int K; K int[] Hi = null; Hi null try (Scanner sc = new Scanner(System.in)) {
            N = sc.nextInt();
            K = sc.nextInt();
            Hi = new int[N];
            for (int i = 0; i < N; i++) {
                Hi[i] = sc.nextInt();
            }
        } {
            N = sc.nextInt();
            K = sc.nextInt();
            Hi = new int[N];
            for (int i = 0; i < N; i++) {
                Hi[i] = sc.nextInt();
            }
        } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) N = sc.nextInt() N sc.nextInt() sc.nextInt sc K = sc.nextInt() K sc.nextInt() sc.nextInt sc Hi = new int[N] Hi new int[N] N for (int i = 0; i < N; i++) {
                Hi[i] = sc.nextInt();
            } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                Hi[i] = sc.nextInt();
            } {
                Hi[i] = sc.nextInt();
            } Hi[i] = sc.nextInt() Hi[i] Hi i sc.nextInt() sc.nextInt sc Arrays.sort(Hi) Arrays.sort Arrays Hi if(K > 0){
            if(K > Hi.length){
                K = Hi.length;
            }
            Arrays.fill(Hi,Hi.length-K,Hi.length ,0);
        } K > 0 K 0 {
            if(K > Hi.length){
                K = Hi.length;
            }
            Arrays.fill(Hi,Hi.length-K,Hi.length ,0);
        } if(K > Hi.length){
                K = Hi.length;
            } K > Hi.length K Hi.length Hi Hi.length {
                K = Hi.length;
            } K = Hi.length K Hi.length Hi Hi.length Arrays.fill(Hi,Hi.length-K,Hi.length ,0) Arrays.fill Arrays Hi Hi.length-K Hi.length Hi Hi.length K Hi.length Hi Hi.length 0 long result = 0; result 0 for(int attack : Hi){
            result += attack;
        } int attack Hi {
            result += attack;
        } {
            result += attack;
        } result += attack result attack System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
    public static void main(String[] args) {
        int N;
        int K;
        int[] Hi = null;
        try (Scanner sc = new Scanner(System.in)) {
            N = sc.nextInt();
            K = sc.nextInt();
            Hi = new int[N];
            for (int i = 0; i < N; i++) {
                Hi[i] = sc.nextInt();
            }
        }
        Arrays.sort(Hi);
        if(K > 0){
            if(K > Hi.length){
                K = Hi.length;
            }
            Arrays.fill(Hi,Hi.length-K,Hi.length ,0);
        }
        long result = 0;
        for(int attack : Hi){
            result += attack;
        }
        System.out.println(result);
    }
} public class Main {
    public static void main(String[] args) {
        int N;
        int K;
        int[] Hi = null;
        try (Scanner sc = new Scanner(System.in)) {
            N = sc.nextInt();
            K = sc.nextInt();
            Hi = new int[N];
            for (int i = 0; i < N; i++) {
                Hi[i] = sc.nextInt();
            }
        }
        Arrays.sort(Hi);
        if(K > 0){
            if(K > Hi.length){
                K = Hi.length;
            }
            Arrays.fill(Hi,Hi.length-K,Hi.length ,0);
        }
        long result = 0;
        for(int attack : Hi){
            result += attack;
        }
        System.out.println(result);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        int N;
        int K;
        int[] Hi = null;
        try (Scanner sc = new Scanner(System.in)) {
            N = sc.nextInt();
            K = sc.nextInt();
            Hi = new int[N];
            for (int i = 0; i < N; i++) {
                Hi[i] = sc.nextInt();
            }
        }
        Arrays.sort(Hi);
        if(K > 0){
            if(K > Hi.length){
                K = Hi.length;
            }
            Arrays.fill(Hi,Hi.length-K,Hi.length ,0);
        }
        long result = 0;
        for(int attack : Hi){
            result += attack;
        }
        System.out.println(result);
    }
}
