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