"use strict";

function Main(input) {
    input = input.split("\n");

    input[0] = input[0].split(" ");
    const n = parseInt(input[0][0], 10);
    const m = parseInt(input[0][1], 10);

    let stores = input.slice(1).map(x => x.split(" ").map(x => parseInt(x, 10)));

    stores.sort(function(a, b) {
        if( a[0] < b[0] ) return -1;
        if( a[0] > b[0] ) return 1;
        return 0;
    });

    let numDrink = 0;
    let totalPrice = 0;
    for (let i = 0; i < n; i++) {
        const store = stores[i];
        for (let j = 0; j < store[1]; j++) {
            if (numDrink == m) {
                break;
            }

            numDrink++;
            totalPrice += store[0];
        }
    }

    console.log(totalPrice);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
