import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
    [n, k] <- getIntList
    hs <- getIntList
    if n <= k then print 0 else solve n k hs
    
solve n k hs = sum . take (n - k) $ sort hs