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

struct S{
  int d,p;
};
bool operator<(S a,S b){
  return a.p<b.p;
}
int n,m;
vector<S> dp;

void init(){
  dp.clear();
}

bool input(){
  cin>>n>>m;
  if(n==0&&m==0)return false;
  for(int i=0;i<n;i++){
    int a,b;
    cin>>a>>b;
    dp.push_back((S){a,b});
  }
  return true;
}

int solve(){
  sort(dp.rbegin(),dp.rend());
  int ans = 0;
  for(auto i:dp){
    if(m<i.d){
      ans += (i.d - m) * i.p;
      m = 0;
    }else{
      m -= i.d;
    }
  }
  return ans;
}

int main(){
  while(init(),input()){
    cout<<solve()<<endl;
  }
}