#include<iostream>
#include<algorithm>
using namespace std;

int main(){
	int n,m;
	cin >> n >> m;
  	pair<long long,long long> d[n];
	long long cnt = 0;
	long long sum = 0;
	for(int i=0; i<n;++i){
		cin >> d[i].first;
		cin >> d[i].second;
	}
	sort(d,d+n);
	int i = 0;
	while(cnt != m){
		if(d[i].second > 0){
			sum += d[i].first;
			d[i].second --;
			cnt ++;
		}else{
			i++;
		}
	}

	cout << sum << endl;
 
}