#include <stdio.h>
struct data{
	int d,p;
};
int main(void){
	struct data D[10000],tmp;
	int n,m,i,j,ans;
	while(1){
		scanf("%d %d",&n,&m);
		if(!n)
			break;
		for(i=0;i<n;i++)
			scanf("%d %d",&D[i].d,&D[i].p);
		for(i=0;i<n-1;i++){
			for(j=n-1;j>i;j--){
				if(D[j-1].p<D[j].p){
					tmp=D[j-1];
					D[j-1]=D[j];
					D[j]=tmp;
				}
			}
		}
		for(i=0;i<n;i++){
			if(!m)
				break;
			if(D[i].d<m){
				m-=D[i].d;
				D[i].d=0;
			}
			else{
				D[i].d-=m;
				m=0;
			}
		}
		ans=0;
		for(i=0;i<n;i++)
			ans+=D[i].d*D[i].p;
		printf("%d\n",ans);
	}
	return 0;
}