import Data.List

main = do
    [n, m] <- map read . words <$> getLine
    abs <- map (map read . words) <$> sequence (replicate n getLine)
    print $ solve (sort abs) m

solve :: [[Int]] -> Int -> Int
solve _ 0 = 0
solve ([a, b]:abs) m = let k = min m b
                           in k * a + solve abs (m - k)