#include <iostream>
#include <algorithm>
#include <utility>
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,k,n) for(int i=k;i<n;i++)
using namespace std;

int main(){
	int n,m;
	while(cin>>n>>m and n>0){
		pair<int,int> a[n]; rep(i,n) cin>>a[i].second>>a[i].first;
		sort(a,a+n);
		int i=n-1;
		while(m>0 and i>=0){
			if(m-a[i].second>=0){
				m-=a[i].second; a[i].second=0;
			}else{
				a[i].second-=m; m=0;
			}
			i--;
		}
		long ans=0;
		rep(i,n) ans+=a[i].first*a[i].second;
		cout<<ans<<endl;
	}
	return 0;
}

