N,M = map(int,input().split())
lsd = []
for i in range(N):
    lsd.append(list(map(int,input().split())))
lsd.sort(key=lambda x:x[0])
ans = 0
i = 0
while M != 0:
    if M >= lsd[i][1]:
        ans += lsd[i][0]*lsd[i][1]
        M -= lsd[i][1]
    else:
        ans += lsd[i][0]*M
        M = 0
    i += 1
print(ans) N,M = map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split M lsd = [] lsd [] for i in range(N):
    lsd.append(list(map(int,input().split()))) i range(N) range N lsd.append(list(map(int,input().split()))) lsd.append lsd append list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split lsd.sort(key=lambda x:x[0]) lsd.sort lsd sort key=lambda x:x[0] key lambda x:x[0] x[0] x 0 x ans = 0 ans 0 i = 0 i 0 while M != 0:
    if M >= lsd[i][1]:
        ans += lsd[i][0]*lsd[i][1]
        M -= lsd[i][1]
    else:
        ans += lsd[i][0]*M
        M = 0
    i += 1 M != 0 M 0 if M >= lsd[i][1]:
        ans += lsd[i][0]*lsd[i][1]
        M -= lsd[i][1]
    else:
        ans += lsd[i][0]*M
        M = 0
     M >= lsd[i][1] M lsd[i][1] [i] lsd i 1 ans += lsd[i][0]*lsd[i][1] ans lsd[i][0]*lsd[i][1] lsd[i][0] [i] lsd i 0 lsd[i][1] [i] lsd i 1 M -= lsd[i][1] M lsd[i][1] [i] lsd i 1 ans += lsd[i][0]*M ans lsd[i][0]*M lsd[i][0] [i] lsd i 0 M M = 0 M 0 i += 1 i 1 print(ans) print ans ans = 0 0 ans M -= lsd[i][1] lsd[i][1] M N,M = map(int,input().split()) map(int,input().split()) N i = 0 0 i ans += lsd[i][0]*lsd[i][1] lsd[i][0]*lsd[i][1] ans M = map(int,input().split()) map(int,input().split()) M i += 1 1 i ans += lsd[i][0]*M lsd[i][0]*M ans M = 0 0 M lsd = [] [] lsd
N,M = map(int,input().split())
lsd = []
for i in range(N):
    lsd.append(list(map(int,input().split())))
lsd.sort(key=lambda x:x[0])
ans = 0
i = 0
while M != 0:
    if M >= lsd[i][1]:
        ans += lsd[i][0]*lsd[i][1]
        M -= lsd[i][1]
    else:
        ans += lsd[i][0]*M
        M = 0
    i += 1
print(ans)