import           Control.Monad
import           Data.List
import           Data.Maybe
import qualified Data.ByteString.Char8         as C8

getInts :: IO [Int]
getInts = fmap (map (fst . fromJust . C8.readInt) . C8.words) C8.getLine

main :: IO ()
main = do
    [n, m] <- getInts
    cs     <- replicateM n $ getInts
    print . purchase m $ sortOn fst . map (\[a, b] -> (a, b)) $ cs

purchase :: Int -> [(Int, Int)] -> Int
purchase m ((a, b) : cs) | m <= b    = m * a
                         | otherwise = a * b + purchase (m - b) cs
purchase _ [] = 0
