import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		int[] h = new int[n];
		long sum = 0;

		for (int i = 0; i < n; i++) {
			h[i] = Integer.parseInt(sc.next());
		}

		Arrays.sort(h);

		for (int i = 0; i < (Math.max(0,n - k)); i++) {
			sum += h[i];
		}
		System.out.println(sum);

		sc.close();
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		int[] h = new int[n];
		long sum = 0;

		for (int i = 0; i < n; i++) {
			h[i] = Integer.parseInt(sc.next());
		}

		Arrays.sort(h);

		for (int i = 0; i < (Math.max(0,n - k)); i++) {
			sum += h[i];
		}
		System.out.println(sum);

		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		int[] h = new int[n];
		long sum = 0;

		for (int i = 0; i < n; i++) {
			h[i] = Integer.parseInt(sc.next());
		}

		Arrays.sort(h);

		for (int i = 0; i < (Math.max(0,n - k)); i++) {
			sum += h[i];
		}
		System.out.println(sum);

		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);

		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		int[] h = new int[n];
		long sum = 0;

		for (int i = 0; i < n; i++) {
			h[i] = Integer.parseInt(sc.next());
		}

		Arrays.sort(h);

		for (int i = 0; i < (Math.max(0,n - k)); i++) {
			sum += h[i];
		}
		System.out.println(sum);

		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int k = Integer.parseInt(sc.next()); k Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int[] h = new int[n]; h new int[n] n long sum = 0; sum 0 for (int i = 0; i < n; i++) {
			h[i] = Integer.parseInt(sc.next());
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			h[i] = Integer.parseInt(sc.next());
		} {
			h[i] = Integer.parseInt(sc.next());
		} h[i] = Integer.parseInt(sc.next()) h[i] h i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Arrays.sort(h) Arrays.sort Arrays h for (int i = 0; i < (Math.max(0,n - k)); i++) {
			sum += h[i];
		} int i = 0; int i = 0; i 0 i < (Math.max(0,n - k)) i (Math.max(0,n - k)) Math.max Math 0 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 sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		int[] h = new int[n];
		long sum = 0;

		for (int i = 0; i < n; i++) {
			h[i] = Integer.parseInt(sc.next());
		}

		Arrays.sort(h);

		for (int i = 0; i < (Math.max(0,n - k)); i++) {
			sum += h[i];
		}
		System.out.println(sum);

		sc.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		int[] h = new int[n];
		long sum = 0;

		for (int i = 0; i < n; i++) {
			h[i] = Integer.parseInt(sc.next());
		}

		Arrays.sort(h);

		for (int i = 0; i < (Math.max(0,n - k)); i++) {
			sum += h[i];
		}
		System.out.println(sum);

		sc.close();
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		int[] h = new int[n];
		long sum = 0;

		for (int i = 0; i < n; i++) {
			h[i] = Integer.parseInt(sc.next());
		}

		Arrays.sort(h);

		for (int i = 0; i < (Math.max(0,n - k)); i++) {
			sum += h[i];
		}
		System.out.println(sum);

		sc.close();
	}
}