import math
N,M = map(int, input().split())
l = [[int(i) for i in input().split()] for j in range(N)]

l.sort()
count = 0
i = 0
while(M > 0):
    M -= l[i][1]
    count += l[i][0]*l[i][1]
    if(M < 0):
        count -= abs(M)*l[i][0]
    i += 1
print(count) import math math N,M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M [int(i) for i in input().split()] for j in range(N) for j in range(N) j range(N) range N for j in range(N) [int(i) for i in input().split()] l = [[int(i) for i in input().split()] for j in range(N)] l [[int(i) for i in input().split()] for j in range(N)] l.sort() l.sort l sort count = 0 count 0 i = 0 i 0 while(M > 0):
    M -= l[i][1]
    count += l[i][0]*l[i][1]
    if(M < 0):
        count -= abs(M)*l[i][0]
    i += 1 M > 0 M 0 M -= l[i][1] M l[i][1] [i] l i 1 count += l[i][0]*l[i][1] count l[i][0]*l[i][1] l[i][0] [i] l i 0 l[i][1] [i] l i 1 if(M < 0):
        count -= abs(M)*l[i][0]
     M < 0 M 0 count -= abs(M)*l[i][0] count abs(M)*l[i][0] abs(M) abs M l[i][0] [i] l i 0 i += 1 i 1 print(count) print count M = map(int, input().split()) map(int, input().split()) M i = 0 0 i count += l[i][0]*l[i][1] l[i][0]*l[i][1] count N,M = map(int, input().split()) map(int, input().split()) N count -= abs(M)*l[i][0] abs(M)*l[i][0] count l = [[int(i) for i in input().split()] for j in range(N)] [[int(i) for i in input().split()] for j in range(N)] l count = 0 0 count i += 1 1 i M -= l[i][1] l[i][1] M
import math
N,M = map(int, input().split())
l = [[int(i) for i in input().split()] for j in range(N)]

l.sort()
count = 0
i = 0
while(M > 0):
    M -= l[i][1]
    count += l[i][0]*l[i][1]
    if(M < 0):
        count -= abs(M)*l[i][0]
    i += 1
print(count)