import java.util.*;
public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		long n=in.nextLong(),c=0,s=0;
		long k=in.nextLong();
		long[] arr=new long[(int)n];
		for(int i=0;i<n;i++)
		{
			arr[i]=in.nextInt();
			s=s+arr[i];
		}
		if(k>=n)
		{
			System.out.println("0");
			System.exit(0);
		}
		Arrays.sort(arr);
		long mid=n-1;
		while(c!=k)
		{
			s=s-arr[(int)mid];
			mid--;
			c++;
		}
		System.out.println(s);
	}
} import java.util.*; util.* java public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		long n=in.nextLong(),c=0,s=0;
		long k=in.nextLong();
		long[] arr=new long[(int)n];
		for(int i=0;i<n;i++)
		{
			arr[i]=in.nextInt();
			s=s+arr[i];
		}
		if(k>=n)
		{
			System.out.println("0");
			System.exit(0);
		}
		Arrays.sort(arr);
		long mid=n-1;
		while(c!=k)
		{
			s=s-arr[(int)mid];
			mid--;
			c++;
		}
		System.out.println(s);
	}
} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		long n=in.nextLong(),c=0,s=0;
		long k=in.nextLong();
		long[] arr=new long[(int)n];
		for(int i=0;i<n;i++)
		{
			arr[i]=in.nextInt();
			s=s+arr[i];
		}
		if(k>=n)
		{
			System.out.println("0");
			System.exit(0);
		}
		Arrays.sort(arr);
		long mid=n-1;
		while(c!=k)
		{
			s=s-arr[(int)mid];
			mid--;
			c++;
		}
		System.out.println(s);
	} main {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		long n=in.nextLong(),c=0,s=0;
		long k=in.nextLong();
		long[] arr=new long[(int)n];
		for(int i=0;i<n;i++)
		{
			arr[i]=in.nextInt();
			s=s+arr[i];
		}
		if(k>=n)
		{
			System.out.println("0");
			System.exit(0);
		}
		Arrays.sort(arr);
		long mid=n-1;
		while(c!=k)
		{
			s=s-arr[(int)mid];
			mid--;
			c++;
		}
		System.out.println(s);
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) long n=in.nextLong() n in.nextLong() in.nextLong in c=0 c 0 s=0; s 0 long k=in.nextLong(); k in.nextLong() in.nextLong in long[] arr=new long[(int)n]; arr new long[(int)n] (int)n for(int i=0;i<n;i++)
		{
			arr[i]=in.nextInt();
			s=s+arr[i];
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			arr[i]=in.nextInt();
			s=s+arr[i];
		} {
			arr[i]=in.nextInt();
			s=s+arr[i];
		} arr[i]=in.nextInt() arr[i] arr i in.nextInt() in.nextInt in s=s+arr[i] s s+arr[i] s arr[i] arr i if(k>=n)
		{
			System.out.println("0");
			System.exit(0);
		} k>=n k n {
			System.out.println("0");
			System.exit(0);
		} System.out.println("0") System.out.println System.out System System.out "0" System.exit(0) System.exit System 0 Arrays.sort(arr) Arrays.sort Arrays arr long mid=n-1; mid n-1 n 1 while(c!=k)
		{
			s=s-arr[(int)mid];
			mid--;
			c++;
		} c!=k c k {
			s=s-arr[(int)mid];
			mid--;
			c++;
		} s=s-arr[(int)mid] s s-arr[(int)mid] s arr[(int)mid] arr (int)mid mid-- mid c++ c System.out.println(s) System.out.println System.out System System.out s String[] args args public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		long n=in.nextLong(),c=0,s=0;
		long k=in.nextLong();
		long[] arr=new long[(int)n];
		for(int i=0;i<n;i++)
		{
			arr[i]=in.nextInt();
			s=s+arr[i];
		}
		if(k>=n)
		{
			System.out.println("0");
			System.exit(0);
		}
		Arrays.sort(arr);
		long mid=n-1;
		while(c!=k)
		{
			s=s-arr[(int)mid];
			mid--;
			c++;
		}
		System.out.println(s);
	}
} public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		long n=in.nextLong(),c=0,s=0;
		long k=in.nextLong();
		long[] arr=new long[(int)n];
		for(int i=0;i<n;i++)
		{
			arr[i]=in.nextInt();
			s=s+arr[i];
		}
		if(k>=n)
		{
			System.out.println("0");
			System.exit(0);
		}
		Arrays.sort(arr);
		long mid=n-1;
		while(c!=k)
		{
			s=s-arr[(int)mid];
			mid--;
			c++;
		}
		System.out.println(s);
	}
} Main
import java.util.*;
public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		long n=in.nextLong(),c=0,s=0;
		long k=in.nextLong();
		long[] arr=new long[(int)n];
		for(int i=0;i<n;i++)
		{
			arr[i]=in.nextInt();
			s=s+arr[i];
		}
		if(k>=n)
		{
			System.out.println("0");
			System.exit(0);
		}
		Arrays.sort(arr);
		long mid=n-1;
		while(c!=k)
		{
			s=s-arr[(int)mid];
			mid--;
			c++;
		}
		System.out.println(s);
	}
}