/* package codechef; // don't place package name! */

import javax.swing.*;
import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
    public static void main (String[] args) throws java.lang.Exception
    {
        // your code goes here
        Scanner s = new Scanner(System.in);
        long N = s.nextInt();
        long K = s.nextInt();
        long H[] = new long[(int) N];
        long sum=0;
        for(int i=0; i<N; i++)
        {
            H[i] = s.nextInt();
        }
        Arrays.sort(H);
        for(int i=0; i<N-K;i++)
        {
            sum+=H[i];
        }
        System.out.println(sum);
    }
} import javax.swing.*; swing.* javax import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java public class Main
{
    public static void main (String[] args) throws java.lang.Exception
    {
        // your code goes here
        Scanner s = new Scanner(System.in);
        long N = s.nextInt();
        long K = s.nextInt();
        long H[] = new long[(int) N];
        long sum=0;
        for(int i=0; i<N; i++)
        {
            H[i] = s.nextInt();
        }
        Arrays.sort(H);
        for(int i=0; i<N-K;i++)
        {
            sum+=H[i];
        }
        System.out.println(sum);
    }
} Main public static void main (String[] args) throws java.lang.Exception
    {
        // your code goes here
        Scanner s = new Scanner(System.in);
        long N = s.nextInt();
        long K = s.nextInt();
        long H[] = new long[(int) N];
        long sum=0;
        for(int i=0; i<N; i++)
        {
            H[i] = s.nextInt();
        }
        Arrays.sort(H);
        for(int i=0; i<N-K;i++)
        {
            sum+=H[i];
        }
        System.out.println(sum);
    } main {
        // your code goes here
        Scanner s = new Scanner(System.in);
        long N = s.nextInt();
        long K = s.nextInt();
        long H[] = new long[(int) N];
        long sum=0;
        for(int i=0; i<N; i++)
        {
            H[i] = s.nextInt();
        }
        Arrays.sort(H);
        for(int i=0; i<N-K;i++)
        {
            sum+=H[i];
        }
        System.out.println(sum);
    } Scanner s = new Scanner(System.in); s new Scanner(System.in) long N = s.nextInt(); N s.nextInt() s.nextInt s long K = s.nextInt(); K s.nextInt() s.nextInt s long H[] = new long[(int) N]; H new long[(int) N] (int) N long sum=0; sum 0 for(int i=0; i<N; i++)
        {
            H[i] = s.nextInt();
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            H[i] = s.nextInt();
        } {
            H[i] = s.nextInt();
        } H[i] = s.nextInt() H[i] H i s.nextInt() s.nextInt s Arrays.sort(H) Arrays.sort Arrays H for(int i=0; i<N-K;i++)
        {
            sum+=H[i];
        } int i=0; int i=0; i 0 i<N-K i N-K N K i++ i++ i {
            sum+=H[i];
        } {
            sum+=H[i];
        } sum+=H[i] sum H[i] H i System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main
{
    public static void main (String[] args) throws java.lang.Exception
    {
        // your code goes here
        Scanner s = new Scanner(System.in);
        long N = s.nextInt();
        long K = s.nextInt();
        long H[] = new long[(int) N];
        long sum=0;
        for(int i=0; i<N; i++)
        {
            H[i] = s.nextInt();
        }
        Arrays.sort(H);
        for(int i=0; i<N-K;i++)
        {
            sum+=H[i];
        }
        System.out.println(sum);
    }
} public class Main
{
    public static void main (String[] args) throws java.lang.Exception
    {
        // your code goes here
        Scanner s = new Scanner(System.in);
        long N = s.nextInt();
        long K = s.nextInt();
        long H[] = new long[(int) N];
        long sum=0;
        for(int i=0; i<N; i++)
        {
            H[i] = s.nextInt();
        }
        Arrays.sort(H);
        for(int i=0; i<N-K;i++)
        {
            sum+=H[i];
        }
        System.out.println(sum);
    }
} Main
/* package codechef; // don't place package name! */

import javax.swing.*;
import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
    public static void main (String[] args) throws java.lang.Exception
    {
        // your code goes here
        Scanner s = new Scanner(System.in);
        long N = s.nextInt();
        long K = s.nextInt();
        long H[] = new long[(int) N];
        long sum=0;
        for(int i=0; i<N; i++)
        {
            H[i] = s.nextInt();
        }
        Arrays.sort(H);
        for(int i=0; i<N-K;i++)
        {
            sum+=H[i];
        }
        System.out.println(sum);
    }
}
