import std.conv, std.stdio;
import std.algorithm, std.array, std.range, std.string;
void main()
{
    auto buf = readln.chomp.split.to!(size_t[]);
    auto stores = new Store[buf[0]];
    foreach (ref elem; stores)
        elem = readln.chomp.store;
    stores.sort();
    auto rest = buf[1];
    ulong answer;
    while (rest)
    {
        auto store = stores.front;
        auto buy = store.stock.min(rest);
        answer += buy * store.price;
        rest -= buy;
        stores.popFront;
    }
    answer.writeln;
}

struct Store
{
    ulong price;
    uint stock;
    int opCmp(Store rhs)
    {
        return cast(int)(price - rhs.price);
    }
}

auto store(string line)
{
    auto buf = line.chomp.split;
    return Store(buf[0].to!ulong, buf[1].to!uint);
}
