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

typedef struct pair { int d, p; } Pair;

int comp(const void* a, const void* b)
{
    Pair x=*((Pair*)a), y=*((Pair*)b);
    return x.d*y.p<y.d*x.p;
}

Pair a[10010];
int main(void)
{
    int n, m;
    while (scanf("%d%d", &n, &m), (n|m)) {
        int i, res;
        for(i=0;i<n;++i) {
            int d, p;
            scanf("%d%d", &d, &p);
            a[i].d=d, a[i].p=p;
        }
        qsort(a, n, sizeof(Pair), comp);

#define min(x, y) x<y?x:y
        res=0;
        for(i=0;i<n;++i) {
            int x=min(m, a[i].d);
            a[i].d-=x;
            m-=x;
            res+=a[i].p*a[i].d;
        }
        printf("%d\n", res);
    }
    return 0;
}