N, M = list(map(int, input().split()))
L = [tuple(map(int, input().split())) for i in range(N)]
L.sort()
# print(L)
ct = 0
cost = 0
i = 0
while ct < M:
    a = min(M-ct, L[i][1])
    ct += a
    cost += a*L[i][0]
    # print(ct,cost)
    i += 1
print(cost) N, M = list(map(int, input().split())) N list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split M tuple(map(int, input().split())) for i in range(N) for i in range(N) i range(N) range N for i in range(N) tuple(map(int, input().split())) tuple map(int, input().split()) map int input().split() ().split () input split L = [tuple(map(int, input().split())) for i in range(N)] L [tuple(map(int, input().split())) for i in range(N)] L.sort() L.sort L sort ct = 0 ct 0 cost = 0 cost 0 i = 0 i 0 while ct < M:
    a = min(M-ct, L[i][1])
    ct += a
    cost += a*L[i][0]
    # print(ct,cost)
    i += 1 ct < M ct M a = min(M-ct, L[i][1]) a min(M-ct, L[i][1]) min M-ct M ct L[i][1] [i] L i 1 ct += a ct a cost += a*L[i][0] cost a*L[i][0] a L[i][0] [i] L i 0 i += 1 i 1 print(cost) print cost i = 0 0 i ct = 0 0 ct a = min(M-ct, L[i][1]) min(M-ct, L[i][1]) a cost = 0 0 cost i += 1 1 i N, M = list(map(int, input().split())) list(map(int, input().split())) N M = list(map(int, input().split())) list(map(int, input().split())) M ct += a a ct cost += a*L[i][0] a*L[i][0] cost L = [tuple(map(int, input().split())) for i in range(N)] [tuple(map(int, input().split())) for i in range(N)] L
N, M = list(map(int, input().split()))
L = [tuple(map(int, input().split())) for i in range(N)]
L.sort()
# print(L)
ct = 0
cost = 0
i = 0
while ct < M:
    a = min(M-ct, L[i][1])
    ct += a
    cost += a*L[i][0]
    # print(ct,cost)
    i += 1
print(cost)