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

int N,M;
int sum;
typedef struct{
	int D;
	int P;
} section;

section s[10000];

int comp(const void* c1, const void* c2){
	section *s1=(section*)c1;
	section *s2=(section*)c2;
	return s2->P - s1->P;
}

void solve(){
	int i;

	for(i=0;i<N;i++){
		scanf("%d %d",&s[i].D,&s[i].P);
	}
	qsort(s,N,sizeof(section),comp);
	sum=0;
	for(i=0;i<N;i++){
		if(M>s[i].D){
			M-=s[i].D;
		}else if(M){
			sum+=(s[i].D-M)*s[i].P;
			M=0;
		}else{
			sum+=s[i].D*s[i].P;
		}
	}
	printf("%d\n",sum);
	return;
}

int main(void){

	while(scanf("%d %d",&N,&M),N){
		solve();
	}
	return 0;
}