#include<bits/stdc++.h>
using namespace std;
const int SZ = 100005;
typedef long long ll;
pair<ll,ll> arr[SZ];
int main(void){
	ll n,m; scanf("%lld %lld",&n,&m);
	for(int i=0;i<(int)n;i++){
		ll x,y; scanf("%lld %lld",&x,&y);
		arr[i]=make_pair(x,y);
	}
	sort(arr,arr+n);
	long long ans = 0LL;
	int p = 0;
	while(m){
		ll buy = min(m,arr[p].second);
		ans += buy*arr[p].first;
		p++;
		m-=buy;
	}
	printf("%lld",ans);
	return 0;
}