#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;i<n;i++){
        cin>>ab[i].first>>ab[i].second;
    }
    sort(ab.begin(),ab.end());
    long long ans=0;
    for(int i=0;i<n;i++){
        if(m<=0)break;
        ans+=(long long)ab[i].first*(long long)min(m,ab[i].second);
        m-=ab[i].second;
    }
    cout<<ans<<endl;
    return 0;
}
