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

 class Main {
    public static void main(String[] args) {
        Scanner enter = new Scanner(System.in);
        int numOfMonster = enter.nextInt();
        int numOfSpecialMoves = enter.nextInt();
        long monsterlifes[] = new long[numOfMonster];
        long addition = 0;

        long max = monsterlifes[0];
        for (int i = 0; i < monsterlifes.length; i++) {
            monsterlifes[i] = enter.nextInt();}
            Arrays.sort(monsterlifes);
            for (int j = numOfMonster - numOfSpecialMoves - 1; j >= 0; j--)

                addition += monsterlifes[j];


        System.out.println(addition);


    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        Scanner enter = new Scanner(System.in);
        int numOfMonster = enter.nextInt();
        int numOfSpecialMoves = enter.nextInt();
        long monsterlifes[] = new long[numOfMonster];
        long addition = 0;

        long max = monsterlifes[0];
        for (int i = 0; i < monsterlifes.length; i++) {
            monsterlifes[i] = enter.nextInt();}
            Arrays.sort(monsterlifes);
            for (int j = numOfMonster - numOfSpecialMoves - 1; j >= 0; j--)

                addition += monsterlifes[j];


        System.out.println(addition);


    }
} Main public static void main(String[] args) {
        Scanner enter = new Scanner(System.in);
        int numOfMonster = enter.nextInt();
        int numOfSpecialMoves = enter.nextInt();
        long monsterlifes[] = new long[numOfMonster];
        long addition = 0;

        long max = monsterlifes[0];
        for (int i = 0; i < monsterlifes.length; i++) {
            monsterlifes[i] = enter.nextInt();}
            Arrays.sort(monsterlifes);
            for (int j = numOfMonster - numOfSpecialMoves - 1; j >= 0; j--)

                addition += monsterlifes[j];


        System.out.println(addition);


    } main {
        Scanner enter = new Scanner(System.in);
        int numOfMonster = enter.nextInt();
        int numOfSpecialMoves = enter.nextInt();
        long monsterlifes[] = new long[numOfMonster];
        long addition = 0;

        long max = monsterlifes[0];
        for (int i = 0; i < monsterlifes.length; i++) {
            monsterlifes[i] = enter.nextInt();}
            Arrays.sort(monsterlifes);
            for (int j = numOfMonster - numOfSpecialMoves - 1; j >= 0; j--)

                addition += monsterlifes[j];


        System.out.println(addition);


    } Scanner enter = new Scanner(System.in); enter new Scanner(System.in) int numOfMonster = enter.nextInt(); numOfMonster enter.nextInt() enter.nextInt enter int numOfSpecialMoves = enter.nextInt(); numOfSpecialMoves enter.nextInt() enter.nextInt enter long monsterlifes[] = new long[numOfMonster]; monsterlifes new long[numOfMonster] numOfMonster long addition = 0; addition 0 long max = monsterlifes[0]; max monsterlifes[0] monsterlifes 0 for (int i = 0; i < monsterlifes.length; i++) {
            monsterlifes[i] = enter.nextInt();} int i = 0; int i = 0; i 0 i < monsterlifes.length i monsterlifes.length monsterlifes monsterlifes.length i++ i++ i {
            monsterlifes[i] = enter.nextInt();} {
            monsterlifes[i] = enter.nextInt();} monsterlifes[i] = enter.nextInt() monsterlifes[i] monsterlifes i enter.nextInt() enter.nextInt enter Arrays.sort(monsterlifes) Arrays.sort Arrays monsterlifes for (int j = numOfMonster - numOfSpecialMoves - 1; j >= 0; j--)

                addition += monsterlifes[j]; int j = numOfMonster - numOfSpecialMoves - 1; int j = numOfMonster - numOfSpecialMoves - 1; j numOfMonster - numOfSpecialMoves - 1 numOfMonster - numOfSpecialMoves - 1 numOfMonster numOfSpecialMoves 1 j >= 0 j 0 j-- j-- j addition += monsterlifes[j]; addition += monsterlifes[j] addition monsterlifes[j] monsterlifes j System.out.println(addition) System.out.println System.out System System.out addition String[] args args
import java.util.Arrays;
import java.util.Scanner;

 class Main {
    public static void main(String[] args) {
        Scanner enter = new Scanner(System.in);
        int numOfMonster = enter.nextInt();
        int numOfSpecialMoves = enter.nextInt();
        long monsterlifes[] = new long[numOfMonster];
        long addition = 0;

        long max = monsterlifes[0];
        for (int i = 0; i < monsterlifes.length; i++) {
            monsterlifes[i] = enter.nextInt();}
            Arrays.sort(monsterlifes);
            for (int j = numOfMonster - numOfSpecialMoves - 1; j >= 0; j--)

                addition += monsterlifes[j];


        System.out.println(addition);


    }
}