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

int main(){
  ll N,M,ans=0;
  cin>>N>>M;
  vector<pair<ll,ll>> X(N);
  for(ll i=0;i<N;i++){
    ll a,b;
    cin>>a>>b;
    X.at(i)=make_pair(a,b);
  }
  sort(X.begin(),X.end());
  for(ll i=0;;i++){
    ll a,b;
    tie(a,b)=X.at(i);
    if(M>b){
      ans+=a*b;
      M-=b;
    }else if(M<=b){
      ans+=M*a;
      break;
    }
  }
  cout<<ans<<endl;
  
}
