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

int main() {
   int N;
   ll M;  cin >> N >> M;
   vector<pair<ll, ll>> v(N);
   
   for(int i = 0; i < N; i++) cin >> v[i].first >> v[i].second;

   sort(v.begin(), v.end());

   ll res = 0;
   ll ans = 0;
   for(int i = 0; i < N && M > 0; i++) {
       ans += v[i].first * min(M, v[i].second);
       M -= min(M, v[i].second);
   }

   cout << ans;

    return 0;

}