#include<bits/stdc++.h>
using namespace std;
long long n,m,p,ans;
vector<pair<long long,long long> >v;
int main()
{
	cin>>n>>m;
	for(int i=0;i<n;i++)
	{
		long long x,y;
		cin>>x>>y;
		v.push_back(make_pair(x,y));
	}
	sort(v.begin(),v.end());
	while(m>0)
	{
		ans+=min(m,v[p].second)*v[p].first;
		m-=v[p].second;
		p++;
	}
	cout<<ans<<endl;
	return 0;
}