import Data.List
import Control.Monad
g a b = compare (head a) (head b)
f a m r = if m==0 then r else if m-((last.head) a)<0 then r+((head.head)a*m) else f (tail a) (m-(last.head)a) (r+(product.head) a)
main=do
 [n,m]<-map read.words<$>getLine
 a<-sortBy g.map (map read.words)<$>replicateM n getLine
 print$f a m 0