import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
        PrintWriter pw = new PrintWriter(System.out);
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String read1 = null;
        String read2 = null;
        try {
            read1 = br.readLine();
            read2 = br.readLine();
            br.close();
        } catch (IOException e){
            e.printStackTrace();
        }
        String str[] = read1.split(" ", 0);
        String str2[] = read2.split(" ", 0);
        int n = Integer.parseInt(str[0]);
        int k = Integer.parseInt(str[1]);
        int at = n - k;
        if (at > 0) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = Integer.parseInt(str2[i]);
            }
            Arrays.sort(a);
            long atc = 0;
            for (int i = 0; i < at; i++) {
                atc = atc + a[i];
            }
            pw.println(atc);
        }else {
            pw.println(0);
        }
        pw.flush();
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Arrays; Arrays java.util public class Main {
    public static void main(String[] args) {
        PrintWriter pw = new PrintWriter(System.out);
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String read1 = null;
        String read2 = null;
        try {
            read1 = br.readLine();
            read2 = br.readLine();
            br.close();
        } catch (IOException e){
            e.printStackTrace();
        }
        String str[] = read1.split(" ", 0);
        String str2[] = read2.split(" ", 0);
        int n = Integer.parseInt(str[0]);
        int k = Integer.parseInt(str[1]);
        int at = n - k;
        if (at > 0) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = Integer.parseInt(str2[i]);
            }
            Arrays.sort(a);
            long atc = 0;
            for (int i = 0; i < at; i++) {
                atc = atc + a[i];
            }
            pw.println(atc);
        }else {
            pw.println(0);
        }
        pw.flush();
    }
} Main public static void main(String[] args) {
        PrintWriter pw = new PrintWriter(System.out);
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String read1 = null;
        String read2 = null;
        try {
            read1 = br.readLine();
            read2 = br.readLine();
            br.close();
        } catch (IOException e){
            e.printStackTrace();
        }
        String str[] = read1.split(" ", 0);
        String str2[] = read2.split(" ", 0);
        int n = Integer.parseInt(str[0]);
        int k = Integer.parseInt(str[1]);
        int at = n - k;
        if (at > 0) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = Integer.parseInt(str2[i]);
            }
            Arrays.sort(a);
            long atc = 0;
            for (int i = 0; i < at; i++) {
                atc = atc + a[i];
            }
            pw.println(atc);
        }else {
            pw.println(0);
        }
        pw.flush();
    } main {
        PrintWriter pw = new PrintWriter(System.out);
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String read1 = null;
        String read2 = null;
        try {
            read1 = br.readLine();
            read2 = br.readLine();
            br.close();
        } catch (IOException e){
            e.printStackTrace();
        }
        String str[] = read1.split(" ", 0);
        String str2[] = read2.split(" ", 0);
        int n = Integer.parseInt(str[0]);
        int k = Integer.parseInt(str[1]);
        int at = n - k;
        if (at > 0) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = Integer.parseInt(str2[i]);
            }
            Arrays.sort(a);
            long atc = 0;
            for (int i = 0; i < at; i++) {
                atc = atc + a[i];
            }
            pw.println(atc);
        }else {
            pw.println(0);
        }
        pw.flush();
    } PrintWriter pw = new PrintWriter(System.out); pw new PrintWriter(System.out) BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String read1 = null; read1 null String read2 = null; read2 null try {
            read1 = br.readLine();
            read2 = br.readLine();
            br.close();
        } catch (IOException e){
            e.printStackTrace();
        } catch (IOException e){
            e.printStackTrace();
        } IOException e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
            read1 = br.readLine();
            read2 = br.readLine();
            br.close();
        } read1 = br.readLine() read1 br.readLine() br.readLine br read2 = br.readLine() read2 br.readLine() br.readLine br br.close() br.close br String str[] = read1.split(" ", 0); str read1.split(" ", 0) read1.split read1 " " 0 String str2[] = read2.split(" ", 0); str2 read2.split(" ", 0) read2.split read2 " " 0 int n = Integer.parseInt(str[0]); n Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 int k = Integer.parseInt(str[1]); k Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 int at = n - k; at n - k n k if (at > 0) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = Integer.parseInt(str2[i]);
            }
            Arrays.sort(a);
            long atc = 0;
            for (int i = 0; i < at; i++) {
                atc = atc + a[i];
            }
            pw.println(atc);
        }else {
            pw.println(0);
        } at > 0 at 0 {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = Integer.parseInt(str2[i]);
            }
            Arrays.sort(a);
            long atc = 0;
            for (int i = 0; i < at; i++) {
                atc = atc + a[i];
            }
            pw.println(atc);
        } int a[] = new int[n]; a new int[n] n for (int i = 0; i < n; i++) {
                a[i] = Integer.parseInt(str2[i]);
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                a[i] = Integer.parseInt(str2[i]);
            } {
                a[i] = Integer.parseInt(str2[i]);
            } a[i] = Integer.parseInt(str2[i]) a[i] a i Integer.parseInt(str2[i]) Integer.parseInt Integer str2[i] str2 i Arrays.sort(a) Arrays.sort Arrays a long atc = 0; atc 0 for (int i = 0; i < at; i++) {
                atc = atc + a[i];
            } int i = 0; int i = 0; i 0 i < at i at i++ i++ i {
                atc = atc + a[i];
            } {
                atc = atc + a[i];
            } atc = atc + a[i] atc atc + a[i] atc a[i] a i pw.println(atc) pw.println pw atc {
            pw.println(0);
        } pw.println(0) pw.println pw 0 pw.flush() pw.flush pw String[] args args public class Main {
    public static void main(String[] args) {
        PrintWriter pw = new PrintWriter(System.out);
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String read1 = null;
        String read2 = null;
        try {
            read1 = br.readLine();
            read2 = br.readLine();
            br.close();
        } catch (IOException e){
            e.printStackTrace();
        }
        String str[] = read1.split(" ", 0);
        String str2[] = read2.split(" ", 0);
        int n = Integer.parseInt(str[0]);
        int k = Integer.parseInt(str[1]);
        int at = n - k;
        if (at > 0) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = Integer.parseInt(str2[i]);
            }
            Arrays.sort(a);
            long atc = 0;
            for (int i = 0; i < at; i++) {
                atc = atc + a[i];
            }
            pw.println(atc);
        }else {
            pw.println(0);
        }
        pw.flush();
    }
} public class Main {
    public static void main(String[] args) {
        PrintWriter pw = new PrintWriter(System.out);
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String read1 = null;
        String read2 = null;
        try {
            read1 = br.readLine();
            read2 = br.readLine();
            br.close();
        } catch (IOException e){
            e.printStackTrace();
        }
        String str[] = read1.split(" ", 0);
        String str2[] = read2.split(" ", 0);
        int n = Integer.parseInt(str[0]);
        int k = Integer.parseInt(str[1]);
        int at = n - k;
        if (at > 0) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = Integer.parseInt(str2[i]);
            }
            Arrays.sort(a);
            long atc = 0;
            for (int i = 0; i < at; i++) {
                atc = atc + a[i];
            }
            pw.println(atc);
        }else {
            pw.println(0);
        }
        pw.flush();
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
        PrintWriter pw = new PrintWriter(System.out);
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String read1 = null;
        String read2 = null;
        try {
            read1 = br.readLine();
            read2 = br.readLine();
            br.close();
        } catch (IOException e){
            e.printStackTrace();
        }
        String str[] = read1.split(" ", 0);
        String str2[] = read2.split(" ", 0);
        int n = Integer.parseInt(str[0]);
        int k = Integer.parseInt(str[1]);
        int at = n - k;
        if (at > 0) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = Integer.parseInt(str2[i]);
            }
            Arrays.sort(a);
            long atc = 0;
            for (int i = 0; i < at; i++) {
                atc = atc + a[i];
            }
            pw.println(atc);
        }else {
            pw.println(0);
        }
        pw.flush();
    }
}