import Data.List
import Control.Monad

main = do
    [n,m] <- map read . words <$> getLine :: IO [Int]
    abs <-  replicateM n (map read . words <$> getLine) :: IO [[Int]]
    print $ solve (sort abs) 0 m

solve :: [[Int]] -> Int -> Int -> Int 
solve _ cPrc 0 =  cPrc
solve (ab:abs) cPrc tNum = if tNum >= b then solve abs (cPrc + a*b) (tNum - b) else cPrc + a*tNum
    where
        a = ab !! 0
        b = ab !! 1