import Control.Monad
import Data.List

main = do
    [n, m] <- fmap read <$> words <$> getLine
    ab <- forM [1..n] $ \i -> do
        [ai, bi] <- fmap read <$> words <$> getLine
        return (ai, bi)
    putStrLn $ show $ solve n m ab

solve :: Int -> Int -> [(Integer, Integer)] -> Integer
solve n m ab = doit (fromIntegral m) (sort ab)
  where
    doit m ((a, b) : ab) | m <= b    = m * a
                         | otherwise = b * a + doit (m - b) ab