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

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int monster = scan.nextInt();
		int waza = scan.nextInt();
		long[] hp = new long[monster];

		for(int i=0;i<monster;i++) {

			hp[i] = scan.nextInt();
		}

		long sum = 0;

		Arrays.sort(hp);

		for(int i=0;i<monster-waza;i++) {

			sum += hp[i];
		}

		   System.out.println(sum);

		scan.close();
	}

} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int monster = scan.nextInt();
		int waza = scan.nextInt();
		long[] hp = new long[monster];

		for(int i=0;i<monster;i++) {

			hp[i] = scan.nextInt();
		}

		long sum = 0;

		Arrays.sort(hp);

		for(int i=0;i<monster-waza;i++) {

			sum += hp[i];
		}

		   System.out.println(sum);

		scan.close();
	}

} Main public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int monster = scan.nextInt();
		int waza = scan.nextInt();
		long[] hp = new long[monster];

		for(int i=0;i<monster;i++) {

			hp[i] = scan.nextInt();
		}

		long sum = 0;

		Arrays.sort(hp);

		for(int i=0;i<monster-waza;i++) {

			sum += hp[i];
		}

		   System.out.println(sum);

		scan.close();
	} main {

		Scanner scan = new Scanner(System.in);

		int monster = scan.nextInt();
		int waza = scan.nextInt();
		long[] hp = new long[monster];

		for(int i=0;i<monster;i++) {

			hp[i] = scan.nextInt();
		}

		long sum = 0;

		Arrays.sort(hp);

		for(int i=0;i<monster-waza;i++) {

			sum += hp[i];
		}

		   System.out.println(sum);

		scan.close();
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int monster = scan.nextInt(); monster scan.nextInt() scan.nextInt scan int waza = scan.nextInt(); waza scan.nextInt() scan.nextInt scan long[] hp = new long[monster]; hp new long[monster] monster for(int i=0;i<monster;i++) {

			hp[i] = scan.nextInt();
		} int i=0; int i=0; i 0 i<monster i monster i++ i++ i {

			hp[i] = scan.nextInt();
		} {

			hp[i] = scan.nextInt();
		} hp[i] = scan.nextInt() hp[i] hp i scan.nextInt() scan.nextInt scan long sum = 0; sum 0 Arrays.sort(hp) Arrays.sort Arrays hp for(int i=0;i<monster-waza;i++) {

			sum += hp[i];
		} int i=0; int i=0; i 0 i<monster-waza i monster-waza monster waza i++ i++ i {

			sum += hp[i];
		} {

			sum += hp[i];
		} sum += hp[i] sum hp[i] hp i System.out.println(sum) System.out.println System.out System System.out sum scan.close() scan.close scan String[] args args public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int monster = scan.nextInt();
		int waza = scan.nextInt();
		long[] hp = new long[monster];

		for(int i=0;i<monster;i++) {

			hp[i] = scan.nextInt();
		}

		long sum = 0;

		Arrays.sort(hp);

		for(int i=0;i<monster-waza;i++) {

			sum += hp[i];
		}

		   System.out.println(sum);

		scan.close();
	}

} public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int monster = scan.nextInt();
		int waza = scan.nextInt();
		long[] hp = new long[monster];

		for(int i=0;i<monster;i++) {

			hp[i] = scan.nextInt();
		}

		long sum = 0;

		Arrays.sort(hp);

		for(int i=0;i<monster-waza;i++) {

			sum += hp[i];
		}

		   System.out.println(sum);

		scan.close();
	}

} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int monster = scan.nextInt();
		int waza = scan.nextInt();
		long[] hp = new long[monster];

		for(int i=0;i<monster;i++) {

			hp[i] = scan.nextInt();
		}

		long sum = 0;

		Arrays.sort(hp);

		for(int i=0;i<monster-waza;i++) {

			sum += hp[i];
		}

		   System.out.println(sum);

		scan.close();
	}

}
