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

void main() {
	auto data = readln.split;
	auto N = data[0].to!long, M = data[1].to!long;
	Tuple!(long, long)[] AB;
	foreach (i; 0 .. N) {
		data = readln.split;
		
		AB ~= tuple(data[0].to!long, data[1].to!long);
	}
	AB = AB.sort!((a,b) => a[0] < b[0]).array;
	long ans, num;
	foreach (i; 0 .. N) {
		if (num + AB[i][0] < M) { ans += AB[i][0]*AB[i][1]; num += AB[i][1]; }
		else { ans += (M-num)*AB[i][0]; break; }
	}
	writeln(ans);
	
}