import Data.List
import Control.Monad
--assuming 1st arg sorted by price
solver::[(Int,Int)]->Int->Int
solver _ 0 = 0
solver ((price,n):xs) m = let buy = min n m in
                            if m == buy then price * buy
                                        else price * buy + (solver xs (m - buy))

main::IO()
main=do
  n:m:[]<-return.map read.words=<<getLine
  dat<-forM [1..n] (\_->return.(\ (a:b:[]) -> (a,b) ).map read.words=<<getLine)
  let srtd = sortBy (\ (p_1,_) -> \ (p_2,_) -> compare p_1 p_2) dat
  print (solver srtd m)
