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

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words

getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
  [n, k] <- getIntList
  h <- getIntList
  print $ solve k h

solve k h = sum $ L.drop k $ L.reverse $ L.sort h