import Control.Monad
import Data.List

solve :: [[Int]] -> Int -> Int -> Int
solve ([a, b]:xs) m sum 
  | m <= 0 = sum
  | m > 0 && m < a = solve xs 0 (sum + m*b)
  | otherwise = solve xs (m - 1) (sum + a * b)


main = do
  [n, m] <- (map read) . words <$> getLine
  input  <- (replicateM n ((map read . words) <$> getLine) :: IO [[Int]])
  let 
    input = sort input
  putStrLn $ show $ solve input m 0 


