"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.main = function (N, M, abList) {
    abList.sort(function (x, y) {
        if (x[0] < y[0])
            return -1;
        if (x[0] > y[0])
            return 1;
        return 0;
    });
    var res = 0;
    var remain = M;
    for (var i = 0; i < N; i++) {
        var _a = abList[i], a = _a[0], b = _a[1];
        if (b < remain) {
            res += a * b;
            remain -= b;
        }
        else {
            res += a * remain;
            break;
        }
    }
    return res;
};
var input = require('fs').readFileSync('/dev/stdin', 'UTF-8');
var lines = input.split('\n');
var _a = lines[0].split(' ').map(function (item) { return Number(item); }), N = _a[0], M = _a[1];
var abList = [];
for (var i = 0; i < N; i++) {
    abList.push(lines[i + 1].split(' ').map(function (l) { return Number(l); }));
}
var res = exports.main(N, M, abList);
console.log(res);
