{-# LANGUAGE BangPatterns #-}
import Data.Int
import Data.List hiding (insert)
import qualified Data.ByteString.Char8 as BS

data Drink = Drink {-# UNPACK #-} !Int64 {-# UNPACK #-} !Int deriving (Eq,Ord)
data Tree = Empty
          | Bin {- key -} {-# UNPACK #-} !Int64 {- value -} {-# UNPACK #-} !Int Tree Tree

insert :: Int64 -> Int -> Tree -> Tree
insert !k !v Empty = Bin k v Empty Empty
insert !k !v (Bin k' v' s t) = case compare k k' of
                                 LT -> Bin k' v' (insert k v s) t
                                 EQ -> Bin k (v + v') s t
                                 GT -> Bin k' v' s (insert k v t)

toList :: Tree -> [(Int64,Int)]
toList = go []
  where
    go xs Empty = xs
    go xs (Bin k v s t) = go ((k,v) : go xs t) s

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