import Data.List

f::String->(Int,Int)
f s=let (x:y:[])=map read (words s)::[Int]
    in (x,y)

f2::[(Int,Int)]->Int->Int->Int
f2 [] _ ans=ans
f2 ((a,b):xs) m ans
    |m<=b=ans+m*a
    |otherwise=f2 xs (m-b) (ans+a*b)

main = do
       e1<-getLine
       es<-getContents
       let xs=lines es
           (n:m:[])=map read (words e1)::[Int]
           ys=sort [f e|e<-xs]
       print $ f2 ys m 0