n,m = map(int,input().split())

lis = []

for _ in range(n):
    a,b = map(int, input().split())
    lis.append([a,b])
    
lis = sorted(lis)

total = 0
cash = 0

for i in range(n):
    if total < m:
        total += lis[i][1]
        cash += lis[i][0] * lis[i][1]
        if total >= m:
            total -= lis[i][1]
            cash -= lis[i][0] * lis[i][1]
            for j in range(lis[i][1]):
                while total < m:
                    total += 1
                    cash += lis[i][0]
    else:
        break

print(cash) n,m = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m lis = [] lis [] for _ in range(n):
    a,b = map(int, input().split())
    lis.append([a,b])
     _ range(n) range n a,b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b lis.append([a,b]) lis.append lis append [a,b] a b lis = sorted(lis) lis sorted(lis) sorted lis total = 0 total 0 cash = 0 cash 0 for i in range(n):
    if total < m:
        total += lis[i][1]
        cash += lis[i][0] * lis[i][1]
        if total >= m:
            total -= lis[i][1]
            cash -= lis[i][0] * lis[i][1]
            for j in range(lis[i][1]):
                while total < m:
                    total += 1
                    cash += lis[i][0]
    else:
        break i range(n) range n if total < m:
        total += lis[i][1]
        cash += lis[i][0] * lis[i][1]
        if total >= m:
            total -= lis[i][1]
            cash -= lis[i][0] * lis[i][1]
            for j in range(lis[i][1]):
                while total < m:
                    total += 1
                    cash += lis[i][0]
    else:
        break total < m total m total += lis[i][1] total lis[i][1] [i] lis i 1 cash += lis[i][0] * lis[i][1] cash lis[i][0] * lis[i][1] lis[i][0] [i] lis i 0 lis[i][1] [i] lis i 1 if total >= m:
            total -= lis[i][1]
            cash -= lis[i][0] * lis[i][1]
            for j in range(lis[i][1]):
                while total < m:
                    total += 1
                    cash += lis[i][0]
     total >= m total m total -= lis[i][1] total lis[i][1] [i] lis i 1 cash -= lis[i][0] * lis[i][1] cash lis[i][0] * lis[i][1] lis[i][0] [i] lis i 0 lis[i][1] [i] lis i 1 for j in range(lis[i][1]):
                while total < m:
                    total += 1
                    cash += lis[i][0]
     j range(lis[i][1]) range lis[i][1] [i] lis i 1 while total < m:
                    total += 1
                    cash += lis[i][0]
     total < m total m total += 1 total 1 cash += lis[i][0] cash lis[i][0] [i] lis i 0 break print(cash) print cash total = 0 0 total cash += lis[i][0] * lis[i][1] lis[i][0] * lis[i][1] cash b = map(int, input().split()) map(int, input().split()) b lis = sorted(lis) sorted(lis) lis n,m = map(int,input().split()) map(int,input().split()) n m = map(int,input().split()) map(int,input().split()) m a,b = map(int, input().split()) map(int, input().split()) a total -= lis[i][1] lis[i][1] total cash = 0 0 cash total += 1 1 total cash -= lis[i][0] * lis[i][1] lis[i][0] * lis[i][1] cash lis = [] [] lis cash += lis[i][0] lis[i][0] cash total += lis[i][1] lis[i][1] total
n,m = map(int,input().split())

lis = []

for _ in range(n):
    a,b = map(int, input().split())
    lis.append([a,b])
    
lis = sorted(lis)

total = 0
cash = 0

for i in range(n):
    if total < m:
        total += lis[i][1]
        cash += lis[i][0] * lis[i][1]
        if total >= m:
            total -= lis[i][1]
            cash -= lis[i][0] * lis[i][1]
            for j in range(lis[i][1]):
                while total < m:
                    total += 1
                    cash += lis[i][0]
    else:
        break

print(cash)