#include<bits/stdc++.h>
using namespace std;
typedef pair<long long,long long> p;

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