Imports System

Module Program
    Sub Main(args As String())

        Dim tmpA As String() = Split(Console.ReadLine(), " ")
        Dim tmpB As String() = Split(Console.ReadLine(), " ")

        Dim N As Long = CLng(tmpA(0))
        Dim K As Long = CLng(tmpA(1))

        If N <= K Then
            Console.WriteLine(0)
            Exit Sub
        End If

        Dim enemy(N) As Long
        Dim i As Integer = 1
        For i = 1 To N
            enemy(i) = CLng(tmpB(i - 1))

        Next

        Array.Sort(enemy)

        Dim attack As Long = 0
        For i = 1 To (N - K)
            attack += enemy(i)
        Next

        Console.WriteLine(attack)

    End Sub
End Module
