#include <bits/stdc++.h>
using namespace std;

int main() {
	long n, m;
	cin >> n >> m;
	pair<long, long> P[n];
	for (int i = 0; i < n; i++) {
		cin >> P[i].first >> P[i].second;
	}
	sort(P, P + n);
	long cnt = 0;
	long ans = 0;
	for (int i = 0; i < n; i++) {
		if (cnt >= m) break;
		ans += P[i].first * min(m - cnt, P[i].second);
		cnt += P[i].second;
	}
	cout << ans << endl;
	return 0;
}