{-# LANGUAGE BangPatterns #-}
import Data.Int
import Data.List
import qualified Data.ByteString.Char8 as BS
import qualified Data.Map.Strict as Map

data Drink = Drink {-# UNPACK #-} !Int64 {-# UNPACK #-} !Int deriving (Eq,Ord)

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 (Drink a (fromIntegral b)) -- (a :: Int64, b :: Int64)
  let solve !k !yen (Drink a b : xs) | k <= b = yen + a * fromIntegral k
                                     | otherwise = solve (k - b) (yen + a * fromIntegral b) xs
  print $ solve m 0 ab
