import qualified Data.ByteString.Char8 as BC
import Data.Maybe
import Data.List

readIntsLines :: IO [[Int]]
readIntsLines = map (map (fst . fromJust . BC.readInt) . BC.words) . BC.lines <$> BC.getContents

solve :: [(Int, Int)] -> Int -> Integer
solve _ 0 = 0
solve ((a, b):abs) m = fromIntegral (count * a) + solve abs (m - count)
  where count = min b m

main :: IO ()
main = do
  [n, m] <- map read . words <$> getLine
  let toTuple [a, b] = (a, b)
  abs <- sortOn fst . map toTuple <$> readIntsLines
  print $ solve abs m