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());
  if (k>=n){
  System.out.println(0);
  }
  int[] m = new int[n];
  long turn = 0;
  if(k<n){
      for (int i = 0; i < n; i++){
  	m[i] = Integer.parseInt(sc.next());
  }
    Arrays.sort(m);
   
    for (int i = 0; i<n-k; i++){
        	turn += m[i];
    }
    System.out.println(turn);
  }
}
} 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());
  if (k>=n){
  System.out.println(0);
  }
  int[] m = new int[n];
  long turn = 0;
  if(k<n){
      for (int i = 0; i < n; i++){
  	m[i] = Integer.parseInt(sc.next());
  }
    Arrays.sort(m);
   
    for (int i = 0; i<n-k; i++){
        	turn += m[i];
    }
    System.out.println(turn);
  }
}
} 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());
  if (k>=n){
  System.out.println(0);
  }
  int[] m = new int[n];
  long turn = 0;
  if(k<n){
      for (int i = 0; i < n; i++){
  	m[i] = Integer.parseInt(sc.next());
  }
    Arrays.sort(m);
   
    for (int i = 0; i<n-k; i++){
        	turn += m[i];
    }
    System.out.println(turn);
  }
} main {
Scanner sc = new Scanner(System.in);
  int n = Integer.parseInt(sc.next());
  int k = Integer.parseInt(sc.next());
  if (k>=n){
  System.out.println(0);
  }
  int[] m = new int[n];
  long turn = 0;
  if(k<n){
      for (int i = 0; i < n; i++){
  	m[i] = Integer.parseInt(sc.next());
  }
    Arrays.sort(m);
   
    for (int i = 0; i<n-k; i++){
        	turn += m[i];
    }
    System.out.println(turn);
  }
} 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 if (k>=n){
  System.out.println(0);
  } k>=n k n {
  System.out.println(0);
  } System.out.println(0) System.out.println System.out System System.out 0 int[] m = new int[n]; m new int[n] n long turn = 0; turn 0 if(k<n){
      for (int i = 0; i < n; i++){
  	m[i] = Integer.parseInt(sc.next());
  }
    Arrays.sort(m);
   
    for (int i = 0; i<n-k; i++){
        	turn += m[i];
    }
    System.out.println(turn);
  } k<n k n {
      for (int i = 0; i < n; i++){
  	m[i] = Integer.parseInt(sc.next());
  }
    Arrays.sort(m);
   
    for (int i = 0; i<n-k; i++){
        	turn += m[i];
    }
    System.out.println(turn);
  } for (int i = 0; i < n; i++){
  	m[i] = Integer.parseInt(sc.next());
  } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
  	m[i] = Integer.parseInt(sc.next());
  } {
  	m[i] = Integer.parseInt(sc.next());
  } m[i] = Integer.parseInt(sc.next()) m[i] m i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Arrays.sort(m) Arrays.sort Arrays m for (int i = 0; i<n-k; i++){
        	turn += m[i];
    } int i = 0; int i = 0; i 0 i<n-k i n-k n k i++ i++ i {
        	turn += m[i];
    } {
        	turn += m[i];
    } turn += m[i] turn m[i] m i System.out.println(turn) System.out.println System.out System System.out turn 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());
  if (k>=n){
  System.out.println(0);
  }
  int[] m = new int[n];
  long turn = 0;
  if(k<n){
      for (int i = 0; i < n; i++){
  	m[i] = Integer.parseInt(sc.next());
  }
    Arrays.sort(m);
   
    for (int i = 0; i<n-k; i++){
        	turn += m[i];
    }
    System.out.println(turn);
  }
}
} 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());
  if (k>=n){
  System.out.println(0);
  }
  int[] m = new int[n];
  long turn = 0;
  if(k<n){
      for (int i = 0; i < n; i++){
  	m[i] = Integer.parseInt(sc.next());
  }
    Arrays.sort(m);
   
    for (int i = 0; i<n-k; i++){
        	turn += m[i];
    }
    System.out.println(turn);
  }
}
} 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());
  if (k>=n){
  System.out.println(0);
  }
  int[] m = new int[n];
  long turn = 0;
  if(k<n){
      for (int i = 0; i < n; i++){
  	m[i] = Integer.parseInt(sc.next());
  }
    Arrays.sort(m);
   
    for (int i = 0; i<n-k; i++){
        	turn += m[i];
    }
    System.out.println(turn);
  }
}
}