import Control.Monad
import Data.List

calc = calc' 0

calc' :: Integer -> Integer -> [(Integer, Integer)] -> Integer
calc' ret n [(a, b)] = ret + a * n
calc' ret n ((a, b):xs)
  | n < b = ret + a * n
  | otherwise = calc' (ret + a * b) (n - b) xs

main = do
  (n:m:_) <- map read . words <$> getLine
  pairs <- sort <$> (replicateM n $ do
    (a:b:_) <- map read . words <$> getLine
    return (a, b))
  print $ calc (fromIntegral m) pairs
