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



#define MAX_P 10
int main(){

int N;//????????°
int M;//??????
int d,p;
int i;
int ans;
int p_p;

int dist[MAX_P+1];



while(scanf("%d %d",&N,&M) == 2 && N){


	//0??§dist????????????????????????
	memset(dist,0,sizeof(dist));

	//?????????????????¨????????????????????????
	
	//for(i=0;i<MAX_P; i++){
	//	dist[i] = 0;
	//}
	

	ans = 0;
	for(i=0; i<N; i++){

		scanf("%d %d",&d,&p);
		//?????±??????????????????p?????????0~10????????§10????????????????????£?????????????´???????????????????????±???????
		dist[p] += d; 
	}

	p_p = MAX_P;

	while(M > 0 && p_p != 0){
		
		if(dist[p_p] == 0){
			p_p--;
			continue;
		}

		dist[p_p]--;
		M--;
	}

	for(i=0; i<=MAX_P; i++){

		ans += dist[i]*i;
	}

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

return 0;

}