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

class Main
{
    public static void main(String args[])
    {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int k = s.nextInt();
        long a[] = new long[n];
        int i;
        for(i=0; i<n; i++)
        {
            a[i] = s.nextInt();
        }
        Arrays.sort(a);
        long sum = 0;
        for(i=n-k-1; i>=0; i--)
        {
            sum += a[i];
        }
        System.out.println(sum);
    }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util class Main
{
    public static void main(String args[])
    {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int k = s.nextInt();
        long a[] = new long[n];
        int i;
        for(i=0; i<n; i++)
        {
            a[i] = s.nextInt();
        }
        Arrays.sort(a);
        long sum = 0;
        for(i=n-k-1; i>=0; i--)
        {
            sum += a[i];
        }
        System.out.println(sum);
    }
} Main public static void main(String args[])
    {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int k = s.nextInt();
        long a[] = new long[n];
        int i;
        for(i=0; i<n; i++)
        {
            a[i] = s.nextInt();
        }
        Arrays.sort(a);
        long sum = 0;
        for(i=n-k-1; i>=0; i--)
        {
            sum += a[i];
        }
        System.out.println(sum);
    } main {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int k = s.nextInt();
        long a[] = new long[n];
        int i;
        for(i=0; i<n; i++)
        {
            a[i] = s.nextInt();
        }
        Arrays.sort(a);
        long sum = 0;
        for(i=n-k-1; i>=0; i--)
        {
            sum += a[i];
        }
        System.out.println(sum);
    } Scanner s = new Scanner(System.in); s new Scanner(System.in) int n = s.nextInt(); n s.nextInt() s.nextInt s int k = s.nextInt(); k s.nextInt() s.nextInt s long a[] = new long[n]; a new long[n] n int i; i for(i=0; i<n; i++)
        {
            a[i] = s.nextInt();
        } i=0; i=0 i 0 i<n i n i++ i++ i {
            a[i] = s.nextInt();
        } {
            a[i] = s.nextInt();
        } a[i] = s.nextInt() a[i] a i s.nextInt() s.nextInt s Arrays.sort(a) Arrays.sort Arrays a long sum = 0; sum 0 for(i=n-k-1; i>=0; i--)
        {
            sum += a[i];
        } i=n-k-1; i=n-k-1 i n-k-1 n-k-1 n k 1 i>=0 i 0 i-- i-- i {
            sum += a[i];
        } {
            sum += a[i];
        } sum += a[i] sum a[i] a i System.out.println(sum) System.out.println System.out System System.out sum String args[] args
import java.util.Scanner;
import java.util.Arrays;

class Main
{
    public static void main(String args[])
    {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int k = s.nextInt();
        long a[] = new long[n];
        int i;
        for(i=0; i<n; i++)
        {
            a[i] = s.nextInt();
        }
        Arrays.sort(a);
        long sum = 0;
        for(i=n-k-1; i>=0; i--)
        {
            sum += a[i];
        }
        System.out.println(sum);
    }
}