#include<stdlib.h>
//#define DEBUG

int N; long M;
typedef struct{
	int D,P;
}Area;
Area area[10000];
void debug(){
	int i;
	for(i = 0; i < N; i++){
		printf("D: %d; P:%d\n", area[i].D, area[i].P);
	}
}
int cmp(const int *a, const int *b){
	return *b-*a;
}
int main(){
	int i;
	long result;
	while(1){
		scanf("%d%d", &N, &M);
		if(N == 0 && M == 0)break;
		for(i = 0; i < N; i++){
			scanf("%d%d", &area[i].D, &area[i].P);
		}
		#ifdef DEBUG
		printf("before sorting\n");
		debug();
		#endif
		qsort(area, N, sizeof(Area),  (int (*)(void *, void *))cmp);
		#ifdef DEBUG
		printf("after sorting\n");
		debug();
		#endif
		i = 0;
		while(M > 0){
			if(area[i].D <= M){
				#ifdef DEBUG
				printf("area[i].D <= M\n");
				#endif
				M -= area[i].D;
				area[i].P = 0;
			}else{
				#ifdef DEBUG
				printf("area[i].D > M\n");
				#endif
				area[i].D -= M;
				M = 0;
			}
			i++;
		}
		#ifdef DEBUG
		debug();
		#endif
		result = 0;
		for(i = 0; i < N; i++){
			result += area[i].D * area[i].P;
		}
		printf("%d\n", result);
	}
	return 0;
}