import Data.List

main = do
  li <- getLine
  let [n,m] = map read $ words li
  co <- getContents
  let abs = map (l2p . map read . words) $ lines co
  print $ compute n m abs

l2p [a,b] = (a,b)

compute :: Int -> Int -> [(Int,Int)] -> Int
compute n m abs = loop m (sort abs)
  where
    loop m ((a,b):abs)
      | m > b = a * b + loop (m - b) abs
      | True  = a * m
