#include <bits/stdc++.h>

#define f first
#define s second
 
using namespace std;

typedef long long ll;
typedef pair<ll, ll> pll;

const ll N = 1e5 + 3;

ll n, m, res;
pll a[N];
 
int main() {
	cin >> n >> m;
	for (ll i = 1; i <= n; ++i) cin >> a[i].f >> a[i].s;
	
	sort(a+1, a+1 + n);

	for (ll i = 1; i <= n && m; ++i) {
		ll tmp = min(m, a[i].s);
		res += tmp * a[i].f;
		m -= tmp;
	}
	cout << res;
	
	return 0;
}
