import std.stdio, std.string, std.range, std.conv, std.array, std.algorithm, std.math, std.typecons;

void main() {
    auto tmp = readln.split.to!(long[]);
    auto N = tmp[0], M = tmp[1];
    struct Data { long price; long limit; }
    auto dataList = new Data[N];
    foreach (i; 0..N) {
        tmp = readln.split.to!(long[]);
        const A = tmp[0], B = tmp[1];
        dataList[i] = Data(A, B);
    }
    dataList = dataList.sort!((a,b) => a.price < b.price).array;
    long res;
    while (M > 0) {
        auto data = dataList[0];
        auto cnt = min(M, data.limit);
        M -= cnt;
        res += data.price * cnt;
        dataList = dataList[1..$];
    }
    writeln(res);
}

