import Data.List

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

main = do
    (n,m) <- parsePair
    pairList <- sequence $ replicate n parsePair :: IO [(Int,Int)]
    let sorted = sortBy (\x y -> compare (fst x) (fst y)) pairList
    print $ solve m 0 sorted


solve :: Int -> Int -> [(Int,Int)] -> Int
solve rest ac ((p,n):xs) = do
        if n >= rest
            then (ac + p*rest)
            else do
                solve (rest - n) (ac + p*n) xs