// AOJ 2019: Princess's Marriage
// 2017.9.30 bal4u@uu
// 2017.11.7 retry

#include <stdio.h>
#include <stdlib.h>

typedef struct { int d, p; } T;
T tbl[10003];

char buf[20], *p;
int getint()
{
	int n = 0;
	while (*p >= '0') n = (n<<3) + (n<<1) + (*p++ & 0xf);
	return n;
}

int cmp(T *a, T *b) { if (b->p - a->p) return b->p - a->p; return a->d - b->d; }

int main()
{
	int n, m, i, sum, ans;

	while (fgets(p=buf, 20, stdin) && *buf != '0') {
		n = getint(), p++, m = getint();
		for (i = 0; i < n; i++) {
			fgets(p=buf, 20, stdin);
			tbl[i].d = getint(), p++, tbl[i].p = getint();
		}
		qsort(tbl, n, sizeof(T), cmp);
		for (ans = sum = 0, i = 0; i < n ; i++) {
			sum += tbl[i].d;
			if (sum > m) { ans = (sum - m) * tbl[i++].p; break; }
		}
		for ( ; i < n; i++) ans += tbl[i].d * tbl[i].p;
		printf("%d\n", ans);
	}
	return 0;
}