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

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