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

#define MAX_P 10
#define MIN(a, b) ((a) < (b) ? (a) : (b))

int main() {
	int n, m;
	int d, p;
	int i;
	int ans;
	int dist[MAX_P + 1];

	while(scanf("%d %d", &n, &m) == 2 && n) {
		memset(dist, 0, sizeof(dist));

		for(i = 0; i < n; ++i) {
			scanf("%d %d", &d, &p);
			dist[p] += d;
		}

		ans = 0;

		for(p = MAX_P; p >= 0; --p) {
			const int len = MIN(dist[p], m);
			ans += p * (dist[p] - len);
			m -= len;
		}

		printf("%d\n", ans);
	}
}