import Data.List

main = do
  [n,k] <- map read . words <$> getLine :: IO [Int]
  hs <- map read . words <$> getLine :: IO [Int]
  putStrLn $ show (ans k hs)

ans :: Int -> [Int] -> Int
ans k hs = sum $ drop k ((reverse . sort) hs)
