import Control.Applicative
import Control.Monad
import Data.List
import Text.Printf

data Shop = Shop Integer Integer

takeDrinks :: Integer -> Integer -> [Shop] -> Integer
takeDrinks costAll needed ((Shop cost stock):rest)
  | needed <= stock = costAll + needed * cost
  | otherwise       = takeDrinks (costAll + cost * stock) (needed - stock) rest

main :: IO ()
main = do
  [shops, needs] <- (map read . words) <$> getLine
  shopData <- replicateM shops getLine
  let shops = (map (\[c, a] -> Shop c a) . map (map read) . map words) shopData
  let sortedShops = sortBy (\ (Shop ca _) (Shop cb _) -> compare ca cb) shops
  printf "%d\n" (takeDrinks 0 (toInteger needs) sortedShops)