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

    var N = parseInt(one[0], 10);
    var M = parseInt(one[1], 10);
    var purchase_count = 0;
    var purchase_money = 0;

    // 店情報マスタ
    var shop_info = {
        Money: '',
        Max_Count: ''
    };

    // 店舗情報格納配列
    var shops_info = [];

    // 店舗情報を格納
    for (var i = 0; i < N; i++) {
        Drinks = args[i + 1].split(' ');
        shops_info[i] = { Money: parseInt(Drinks[0], 10), Max_Count: parseInt(Drinks[1], 10)}
    }

    // 降順にソート
    shops_info.sort((a, b) => { return (a.Money < b.Money) ? -1 : 1;})

    var target_shop;

    for (var i = 0; i < N; i++) {
        // 検査する店舗
        target_shop = shops_info[i];
        // 全部購入しても足りない場合
        if (target_shop.Max_Count + purchase_count <= M) {
            // 合計金額と合計購入数を足し上げ
            purchase_money += target_shop.Max_Count * target_shop.Money;
            purchase_count += target_shop.Max_Count;
        } else {
            // 購入不足分を購入
            target_count = M - purchase_count;
            purchase_money += target_shop.Money * target_count;
            break;
            }
        }

    // 購入費用を出力
    console.log(purchase_money);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
