// AOJ 2019: Princess's Marriage
// 2017.9.30

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

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

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

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

	while (scanf("%d%d", &n, &m) && n > 0) {
		for (i = 0; i < n; i++) scanf("%d%d", &tbl[i].d, &tbl[i].p);
		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;
}