#include <bits/stdc++.h>
using namespace std;
int main(){
	long long a,b;
	cin>>a>>b;
	pair<long long,long long>ar[a];
	for(int i=0;i<a;i++){
		cin>>ar[i].first>>ar[i].second;
	}
	sort(ar,ar+a);
	long long sum=0;
	for(int i=0;b>0;i++){
		if(b>=ar[i].second){
			sum+=ar[i].second*ar[i].first;
			b-=ar[i].second;
		}
		else{
			sum+=b*ar[i].first;
			b-=b;
		}
	}
	cout<<sum<<endl;
}