{-# LANGUAGE BangPatterns #-}
import Data.Int
import Data.List
import qualified Data.Vector.Unboxed as V
import qualified Data.ByteString.Char8 as BS

main = do
  [n,m] <- map (read . BS.unpack) . BS.words <$> BS.getLine
  ab <- fmap sort $ sequence $ replicate n $ do
    [a,b] <- map (read . BS.unpack) . BS.words <$> BS.getLine
    return (a :: Int64, b :: Int64)
  let solve !k !yen ((a,b):xs) | k <= b = yen + a * k
                               | otherwise = solve (k - b) (yen + a * b) xs
  print $ solve (fromIntegral m) 0 ab
