n, m = map(int, input().split())
ll = []
for i in range(n):
    l = list(map(int, input().split()))
    ll.append(l)

ll.sort()

t = 0
cst = 0
i = 0
while t < m:
    t += ll[i][1]
    cst += ll[i][0]*ll[i][1]
    if t > m:
        cst -= ll[i][0]*(t-m)
    i += 1
print(cst) n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m ll = [] ll [] for i in range(n):
    l = list(map(int, input().split()))
    ll.append(l) i range(n) range n l = list(map(int, input().split())) l list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ll.append(l) ll.append ll append l ll.sort() ll.sort ll sort t = 0 t 0 cst = 0 cst 0 i = 0 i 0 while t < m:
    t += ll[i][1]
    cst += ll[i][0]*ll[i][1]
    if t > m:
        cst -= ll[i][0]*(t-m)
    i += 1 t < m t m t += ll[i][1] t ll[i][1] [i] ll i 1 cst += ll[i][0]*ll[i][1] cst ll[i][0]*ll[i][1] ll[i][0] [i] ll i 0 ll[i][1] [i] ll i 1 if t > m:
        cst -= ll[i][0]*(t-m)
     t > m t m cst -= ll[i][0]*(t-m) cst ll[i][0]*(t-m) ll[i][0] [i] ll i 0 t-m t m i += 1 i 1 print(cst) print cst cst -= ll[i][0]*(t-m) ll[i][0]*(t-m) cst ll = [] [] ll n, m = map(int, input().split()) map(int, input().split()) n l = list(map(int, input().split())) list(map(int, input().split())) l cst += ll[i][0]*ll[i][1] ll[i][0]*ll[i][1] cst m = map(int, input().split()) map(int, input().split()) m i = 0 0 i i += 1 1 i cst = 0 0 cst t = 0 0 t t += ll[i][1] ll[i][1] t
n, m = map(int, input().split())
ll = []
for i in range(n):
    l = list(map(int, input().split()))
    ll.append(l)

ll.sort()

t = 0
cst = 0
i = 0
while t < m:
    t += ll[i][1]
    cst += ll[i][0]*ll[i][1]
    if t > m:
        cst -= ll[i][0]*(t-m)
    i += 1
print(cst)