#include <bits/stdc++.h>

using namespace std;

pair<int, int> a[111111];
int main() {
	int n, m;
	cin >> n >> m;
	for (int i = 0; i < n; i++)
		scanf("%d%d", &a[i].first, &a[i].second);
	sort(a, a + n);
	long r = 0;
	for (int i = 0; i < n; i++) {
		long x = min(m, a[i].second);
		r += x * a[i].first;
		m -= x;
	}
	cout << r << endl;
	return 0;
}
