[<AutoOpen>]
module Program

open System

let read f = stdin.ReadLine() |> f
let reads f = stdin.ReadLine().Split() |> Array.toList |> List.map f

let rec solve yen rest = function
    | [] -> yen
    | (a, b) :: xs ->
        if rest = 0I then
            yen
        elif rest >= b then
            solve (yen + a * b) (rest - b) xs
        else
            solve (yen + a * rest) 0I xs

[<EntryPoint>]
let main _ =
    let [n;m] = reads Numerics.BigInteger.Parse
    let xs =
        List.map (fun _ -> reads Numerics.BigInteger.Parse |> fun [a;b] -> (a, b)) [1 .. int n]
        |> List.sortBy fst
    solve 0I m xs
    |> printfn "%A"
    0