#include <iostream>
#include <algorithm>
using namespace std;


class A{
public:
  int D, P;
  bool operator <(const A &a) const {
    if(P != a.P) return P > a.P;
    return D > a.D;
  }
};

int main() {
  while(1) {
    int N, M;
    A a[10000];
    int sum;

    cin >> N >> M;
    if(N == 0 && M == 0) break;

    sum = 0;
    for(int i = 0; i < N; i++) {
      cin >> a[i].D >> a[i].P;
      sum += a[i].D * a[i].P;
    }
    sort(&a[0], &a[N]);

    for(int i = 0; i < N; i++) {
      if(M <= a[i].D) {
	sum -= M*a[i].P;
	break;
      } else {
	sum -= a[i].D*a[i].P;
	M -= a[i].D;
      }
    }
    cout << sum << endl;
  }
}