#include <bits/stdc++.h>
using namespace std;
const long long INF = 100000000;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  long long n, m;
  cin >> n >> m;
  vector<vector<long long> > a(n, vector<long long>(2));
  for (long long i = 0; i < (n); i++) cin >> a[i][0] >> a[i][1];
  long long ans = 0, num = 0, add = 0;
  sort(a.begin(), a.end());
  for (long long i = 0; i < (n); i++) {
    ans += a[i][0] * min(a[i][1], m - num);
    num += min(a[i][1], m - num);
    if (num == m) break;
  }
  cout << ans << endl;
}
