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

void main()
{
	while (1) {
		auto x = readln.chomp.split.map!(to!int);
		if (!x[0]) break;
		auto path = new int[][](x[0], 2);
		int sum;
		foreach (i; 0..x[0]) {
			path[i] = readln.chomp.split.map!(to!int).array;
			sum += path[i][0] * path[i][1];
		}
		path = path.sort!("a[1] > b[1]").array;
		int i;
		auto m = x[1];
		foreach (e; path) {
			if (m <= 0) break;
			auto t = min(m, e[0]);
			sum -= t * e[1];
			i++;
			m -= t;
		}
		sum.writeln;
	}
}