#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int main() {
	int n, m;
	cin >> n >> m;
	vector<pair<int, int>> a(n);
	for (int i = 0; i < n; i++)
		cin >> a[i].first >> a[i].second;
	sort(a.begin(), a.end());
	long long sum = 0, value = 0;
	int i = 0;
	while (sum < m) {
		value += a[i].first;
		a[i].second--;
		if (!a[i].second)
			i++;
		sum++;
	}
	cout << value << endl;
	return 0;
}