import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.string;

alias Edge = Tuple!(int, "u", int, "v");

void main() {
    auto s = readln.split.map!(to!int);
    auto N = s[0];
    auto M = s[1].to!long;
    auto AB = N.iota.map!(_ => readln.split.map!(to!long).array).array;

    AB.sort();
    long cnt = 0;
    long ans = 0;

    foreach (ab; AB) {
        if (cnt == M) break;
        long a = ab[0];
        long b = ab[1];
        b = min(M-cnt, b);
        cnt += b;
        ans += a * b;
    }

    ans.writeln;
}
