import Data.List
import Data.Ord

parsePair :: IO (Int, Int)
parsePair = do
    [a,b] <- (map read . words) <$> getLine
    return (a,b)

main = do
    (n,m) <- parsePair
    pairList <- sequence $ replicate n parsePair
    let sorted = sortBy (comparing fst) pairList
    print $ solve m 0 sorted


solve :: Int -> Int -> [(Int,Int)] -> Int
solve rest ac ((p,n):xs)
    | n >= rest     = (ac + p*rest)
    | otherwise     = solve (rest - n) (ac + p*n) xs