'use strict'

function main(input) {
    const args = input.split('\n');
    const oneL = args[0].split(' ');

    const needDrinkNum = parseInt(oneL[1], 10);

    let shopProp = args.slice(1).map(l1 => {
        return l1.split(' ').map(l2 => parseInt(l2, 10));
    }).sort((a, b) => {
        if (a[0] < b[0]) {
            return -1;
        }
        if (a[0] > b[0]) {
            return 1;
        }
        return 0;
    });

    let value = 0;
    let drink = 0;

    for (let i = 0; i !== shopProp.length && needDrinkNum !== drink; i++) {
        while (shopProp[i][1] !== 0 && needDrinkNum !== drink) {
            value += shopProp[i][0];
            drink ++;
            shopProp[i][1] = shopProp[i][1] - 1;
        }
    }

    console.log(value);
}
 
main(require('fs').readFileSync('/dev/stdin', 'utf8'));