module Main where

import Data.List
import Control.Monad
import Debug.Trace

solve :: [(Integer,Integer)] -> Integer  -> Integer
solve abs m = fst $ foldl inner (0, m) sortedAbs where 
    sortedAbs = sortOn fst abs
    inner (money, remain_drinks) (a,b) = 
        if remain_drinks == 0 then
            (money, remain_drinks)
        else if remain_drinks <= b then
            (money + a*remain_drinks, 0)
        else
            (money + a*b, remain_drinks - b)

getAB :: IO (Integer, Integer)
getAB = do
    [n,m] <- fmap read . words <$> getLine
    pure (n,m)

main = do
    [n,m] <- fmap read . words <$> getLine
    abs <- replicateM n getAB
    print $ solve abs (fromIntegral m )




