import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        long ac = 0;
        int[] hArray = new int[n];
        for(int i = 0; i < n; i++) hArray[i] = Integer.parseInt(sc.next());
        Arrays.sort(hArray);
        n -= k;
        for(int i = 0; i < n; i++) ac += hArray[i];
        System.out.println(ac);
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        long ac = 0;
        int[] hArray = new int[n];
        for(int i = 0; i < n; i++) hArray[i] = Integer.parseInt(sc.next());
        Arrays.sort(hArray);
        n -= k;
        for(int i = 0; i < n; i++) ac += hArray[i];
        System.out.println(ac);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        long ac = 0;
        int[] hArray = new int[n];
        for(int i = 0; i < n; i++) hArray[i] = Integer.parseInt(sc.next());
        Arrays.sort(hArray);
        n -= k;
        for(int i = 0; i < n; i++) ac += hArray[i];
        System.out.println(ac);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        long ac = 0;
        int[] hArray = new int[n];
        for(int i = 0; i < n; i++) hArray[i] = Integer.parseInt(sc.next());
        Arrays.sort(hArray);
        n -= k;
        for(int i = 0; i < n; i++) ac += hArray[i];
        System.out.println(ac);
    } 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 ac = 0; ac 0 int[] hArray = new int[n]; hArray new int[n] n for(int i = 0; i < n; i++) hArray[i] = Integer.parseInt(sc.next()); int i = 0; int i = 0; i 0 i < n i n i++ i++ i hArray[i] = Integer.parseInt(sc.next()); hArray[i] = Integer.parseInt(sc.next()) hArray[i] hArray i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Arrays.sort(hArray) Arrays.sort Arrays hArray n -= k n k for(int i = 0; i < n; i++) ac += hArray[i]; int i = 0; int i = 0; i 0 i < n i n i++ i++ i ac += hArray[i]; ac += hArray[i] ac hArray[i] hArray i System.out.println(ac) System.out.println System.out System System.out ac String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        long ac = 0;
        int[] hArray = new int[n];
        for(int i = 0; i < n; i++) hArray[i] = Integer.parseInt(sc.next());
        Arrays.sort(hArray);
        n -= k;
        for(int i = 0; i < n; i++) ac += hArray[i];
        System.out.println(ac);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        long ac = 0;
        int[] hArray = new int[n];
        for(int i = 0; i < n; i++) hArray[i] = Integer.parseInt(sc.next());
        Arrays.sort(hArray);
        n -= k;
        for(int i = 0; i < n; i++) ac += hArray[i];
        System.out.println(ac);
    }
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        long ac = 0;
        int[] hArray = new int[n];
        for(int i = 0; i < n; i++) hArray[i] = Integer.parseInt(sc.next());
        Arrays.sort(hArray);
        n -= k;
        for(int i = 0; i < n; i++) ac += hArray[i];
        System.out.println(ac);
    }
}