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