import Control.Monad (replicateM)
import Data.List (sortOn, findIndex)

main :: IO ()
main = do
  [n, m] <- fmap (map (read :: String -> Int) . words) $ getLine
  xss <- fmap (map (map (read :: String -> Int) . words)) $ getNLine_ n
  print $ saishou m xss
  
saishou :: Int -> [[Int]] -> Int
saishou m xss = (sum . map (\(x:y:[]) -> x*y)) $
  take (func xss') xss' ++ [[xs !! 0, (xs !! 1) - (sum . map (!! 1) . take (func xss')) xss']]
  where xs = xss' !! (func xss')
        xss' = sortOn (!! 0) xss
        func yss = (\(Just a) -> a) $ findIndex (> m) $
                     scanl (\y zs -> y + (zs !! 1)) 0 yss

-- 複数行入力
getNLine_ :: Int -> IO [String]
getNLine_ n = replicateM n getLine