import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as BS
main=do
 [n,m]<-map read.words<$>getLine
 ab<-replicateM n (map (read.BS.unpack).BS.words<$>BS.getLine)
 print(f m (sort ab) 0)
  where f m ([a,b]:ab) i = if m<=b then (i+m*a) else (f (m-b) ab (i+b*a))