#include "bits/stdc++.h"
using namespace std;
const int maxn = 200200;
int main(){
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > u;
  for(int i = 0; i < n; i++){
    int a, b;
    cin >> a >> b;
    u.push_back({a, b});
  }
  sort(u.begin(), u.end());
  long long ans = 0;
  for(int i = 0; i < n; i++){
    int take = min(m, u[i].second);
    ans += 1ll * take * u[i].first;
    m -= take;
  }
  cout << ans << endl;
  return 0;
}
