{-# LANGUAGE BangPatterns #-}

import Control.Monad
import Data.List
import Data.Maybe
import qualified Data.ByteString.Char8 as C8

type Pair = (Int, Int)

main :: IO ()
main = do
  [n,m] <- readInts
  ps <- sortOn fst <$> replicateM n readPair
  print $ solve (0,0) m ps


solve :: Pair -> Int -> [Pair] -> Int
solve (!s,_) _ [] = s
solve (!s,!n) m ((a,b):ps)
    | n == m    = s
    | c > m     = s+a*(m-n)
    | otherwise = solve (s+a*b,c) m ps
  where
    c = n+b

-- utils
readInts :: IO [Int]
readInts = map (fst . fromJust . C8.readInt) . C8.words <$> C8.getLine

readPair :: IO Pair
readPair = do
  [x,y] <- readInts
  return (x,y)