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

int main() {
  int N, M;
  cin >> N >> M;
  vector<pair<int, int>> AB(N);
  for (int i = 0, a, b; cin >> a >> b; i++) AB.at(i) = {a, b};
  sort(AB.begin(), AB.end());
  long ans = 0;
  int it = 0;
  while (M--) {
    if (AB.at(it).second == 0) it++;
    ans += AB.at(it).first, AB.at(it).second--;
  }
  cout << ans << "\n";
}