module Main where

import qualified Data.Vector as V
import           Data.List
import           Control.Applicative
import           Control.Monad

main :: IO ()
main = do
  [n, m] <- map read . words <$> getLine
  ns <- fmap (sortBy (\(a:_) (b:_) -> compare a b)) . replicateM n
    $ map read . words <$> getLine
  print $ f1 ns 0 0 m

f1 [] _ mny _ = mny
f1 (n:ns) cnt mny m
  | cnt + last n < m = f1 ns (cnt + last n) (mny + last n * head n) m
  | otherwise = mny + (m - cnt) * head n
