{-# 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 :: Int -> [Pair] -> Int
-- solve m = fst . foldl' f e
--   where
--     e = (0,0)
--     f (!s,!n) (a,b)
--       | n == m    = (s,n)
--       | c > m     = (s+a*(m-n),m)
--       | otherwise = (s+a*b,c)
--       where
--         c = n+b

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)