#include<bits/stdc++.h>

using namespace std;
int a[100005],b[100005];
vector<pair<int,int> >v;
int main(){
	int n,m;
	cin>>n>>m;
	for(int i=0;i<n;i++){
		cin>>a[i]>>b[i];
		v.push_back(make_pair(a[i],b[i]));
	}
	long long ans=0;
	sort(v.begin(),v.end());
	for(int i=0;i<n;i++){
		long long k=min(m,v[i].second);
		ans+=k*v[i].first;
		m-=k;
	}
	cout<<ans;
	return 0;
}