#include <stdio.h>
#include <stdlib.h>

#define N 10000
#define INT(X) \
  ( *( (int *)(X) ) )

int cmpr (
  const void  * a,
  const void  * b
  )
{
  return ( INT( b ) - INT( a ) );
}

/** Application main entry point. */
int main (
  int     argc,
  char  * argv[ ]
  )
{
  int i;

  for ( ; ; )
  {
    int d[ N ][ 2 ];
    int res = 0;
    int n, m;

    scanf ( "%d%d", &n, &m );
    if ( !( n | m ) ) break ;

    for ( i = 0; i < n; ++i )
    {
      scanf ( "%d%d", &d[ i ][ 1 ], &d[ i ][ 0 ] );
    }
    qsort ( d, n, sizeof ( int ) * 2, cmpr );

    for ( i = 0; i < n && m > 0; ++i )
    {
      if ( d[ i ][ 1 ] <= m )
      {
        m -= d[ i ][ 1 ];
        d[ i ][ 1 ] = 0;
      }
      else
      {
        d[ i ][ 1 ] -= m;
        m = 0;
      }
    }

    for ( i = 0; i < n; ++i )
    {
      res += d[ i ][ 1 ] * d[ i ][ 0 ];
    }
    printf ( "%d\n", res );
  }

  return ( 0 );
}