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

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

void main() {
    auto nm = readints;
    int n = nm[0], m = nm[1];
    long[][] a;
    for (int i = 0; i < n; i++) {
        a ~= reads!long;
    }

    a.sort!((a, b) => a[0] < b[0]);
    long ans = 0;
    long cnt = 0;
    foreach (e; a) {
        auto req = min(m - cnt, e[1]);

        ans += e[0] * req;
        cnt += req;
        if (cnt >= m) break;
    }
    writeln(ans);
}
