n, m  = map(int, input().split())
a_b = []

for i in range(n):
    a_b.append(list(map(int, input().split())))

a_b.sort()

res = 0
counter = 0
for i in range(n):
    counter = min(m, a_b[i][1])
    m -= counter
    res += counter * a_b[i][0]
    if m == 0:
        break
print(res) n, m  = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m a_b = [] a_b [] for i in range(n):
    a_b.append(list(map(int, input().split()))) i range(n) range n a_b.append(list(map(int, input().split()))) a_b.append a_b append list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split a_b.sort() a_b.sort a_b sort res = 0 res 0 counter = 0 counter 0 for i in range(n):
    counter = min(m, a_b[i][1])
    m -= counter
    res += counter * a_b[i][0]
    if m == 0:
        break i range(n) range n counter = min(m, a_b[i][1]) counter min(m, a_b[i][1]) min m a_b[i][1] [i] a_b i 1 m -= counter m counter res += counter * a_b[i][0] res counter * a_b[i][0] counter a_b[i][0] [i] a_b i 0 if m == 0:
        break m == 0 m 0 break print(res) print res res += counter * a_b[i][0] counter * a_b[i][0] res m  = map(int, input().split()) map(int, input().split()) m counter = 0 0 counter counter = min(m, a_b[i][1]) min(m, a_b[i][1]) counter a_b = [] [] a_b m -= counter counter m n, m  = map(int, input().split()) map(int, input().split()) n res = 0 0 res
n, m  = map(int, input().split())
a_b = []

for i in range(n):
    a_b.append(list(map(int, input().split())))

a_b.sort()

res = 0
counter = 0
for i in range(n):
    counter = min(m, a_b[i][1])
    m -= counter
    res += counter * a_b[i][0]
    if m == 0:
        break
print(res)