--{-# LANGUAGE OverloadedStrings #-}
--{-# LANGUAGE OverloadedLists   #-}
{-# LANGUAGE BangPatterns      #-} --引数に!
{-# LANGUAGE MultiWayIf        #-}
{-# LANGUAGE TupleSections     #-}

import Data.List
import Data.Tree
import Data.Array  --変数衝突
import Data.Array.Unboxed
import Data.Array.MArray
import Data.Array.ST
--import Data.Vector as V　--変数衝突
import qualified Data.Vector.Unboxed as V (last,(!),fromList,Vector)
import Control.Monad
import Control.Monad.State
import Control.Monad.ST

solve :: Int -> [(Int,Int)] -> Int
solve m []         = 0
solve m ((a,b):ls) | m < 0 = 0
                   | otherwise = if m >= b then b*a + (solve (m-b) ls)
                     else m*a

main :: IO ()
main = do
  [n,m] <- map read.words <$> getLine
  ls <- replicateM n $ do
    (a:b:cs) <- map read.words <$> getLine
    return (a,b)
  putStrLn $ show $ solve m (sortOn fst ls)
