void main() {
    long[] tmp = readln.split.to!(long[]);
    long n = tmp[0], m = tmp[1];
    long[] a = new long[n], b = new long[n];
    foreach (i; 0 .. n) {
        tmp = readln.split.to!(long[]);
        a[i] = tmp[0], b[i] = tmp[1];
    }
    zip(a, b).sort!((x, y) => x[0] < y[0]);
    long cnt, money;
    foreach (i; 0 .. n) {
        if (cnt + b[i] < m) {
            money += a[i] * b[i];
            cnt += b[i];
        } else {
            money += a[i] * (m - cnt);
            break;
        }
    }
    money.writeln;
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.container;
import std.typecons;
import std.ascii;
import std.uni;