/*
AizuOnline A2019
Princess's Marriage
*/
#include <stdio.h>
#include <stdlib.h>

int N;
long M;
struct DP
{ int D;
  int P;};

struct DP inf[10000];

int comp_P(void *a,void *b)
{
  return (((int *)b)[1] - ((int *)a)[1]);
}
print()
{ int i;
  for(i=0;i<N;i++)
    printf("%d:%d\n",inf[i].D,inf[i].P);
}

main()
{
  int i,j;
  long sum;
  //printf("SDP:%d\n",sizeof(struct DP));

  while(EOF != scanf("%d %ld",&N,&M) && (N || M))
    {
      for(i=0;i<N;i++)
	scanf("%d %d",&(inf[i].D),&(inf[i].P));
      //print();
      qsort(&(inf[0]),N,sizeof(struct DP),(__compar_fn_t)comp_P);
      //print();
      for(i=0;i<N;i++)
	{
	  if(M < inf[i].D)
	    goto NOKORI;
	  M -=   inf[i].D;
	}
      printf("0\n");
      continue;
    NOKORI:
      sum =  (inf[i].D-M)*inf[i].P;
      for(j=i+1;j<N;j++)
	sum += inf[j].D*inf[j].P;
      printf("%ld\n",sum);
    }
    


return(0);
}