import Control.Monad
import Data.List

solve :: [[Int]] -> Int -> Int -> Int
solve ([a, b]:xs) m sum 
  | m <= 0 = sum
  | m <= b = solve xs 0 (sum + m*a)
  | otherwise = solve xs (m - b) (sum + a * b)
solve [] 0 sum = sum
solve [] _ _ = error "hoge"


main = do
  [n, m] <- (map read) . words <$> getLine
  input  <- (replicateM n ((map read . words) <$> getLine) :: IO [[Int]])
  let 
    input' = sort input
  putStrLn $ show $ solve input' m 0 


