n, m = map(int, input().split())
k = [list(map(int, input().split())) for _ in range(n)]

sum = 0
mr = 0
ks = sorted(k)

for i in range(n):
    if ks[i][1] < (m-mr):
        sum += ks[i][0] * ks[i][1]
        mr += ks[i][1]

    else:
        sum += ks[i][0] * (m - mr)
        break

print(sum) n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m list(map(int, input().split())) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split k = [list(map(int, input().split())) for _ in range(n)] k [list(map(int, input().split())) for _ in range(n)] sum = 0 sum 0 mr = 0 mr 0 ks = sorted(k) ks sorted(k) sorted k for i in range(n):
    if ks[i][1] < (m-mr):
        sum += ks[i][0] * ks[i][1]
        mr += ks[i][1]

    else:
        sum += ks[i][0] * (m - mr)
        break i range(n) range n if ks[i][1] < (m-mr):
        sum += ks[i][0] * ks[i][1]
        mr += ks[i][1]

    else:
        sum += ks[i][0] * (m - mr)
        break ks[i][1] < (m-mr) ks[i][1] [i] ks i 1 m-mr m mr sum += ks[i][0] * ks[i][1] sum ks[i][0] * ks[i][1] ks[i][0] [i] ks i 0 ks[i][1] [i] ks i 1 mr += ks[i][1] mr ks[i][1] [i] ks i 1 sum += ks[i][0] * (m - mr) sum ks[i][0] * (m - mr) ks[i][0] [i] ks i 0 m - mr m mr break print(sum) print sum ks = sorted(k) sorted(k) ks sum += ks[i][0] * (m - mr) ks[i][0] * (m - mr) sum mr = 0 0 mr sum += ks[i][0] * ks[i][1] ks[i][0] * ks[i][1] sum n, m = map(int, input().split()) map(int, input().split()) n k = [list(map(int, input().split())) for _ in range(n)] [list(map(int, input().split())) for _ in range(n)] k m = map(int, input().split()) map(int, input().split()) m sum = 0 0 sum mr += ks[i][1] ks[i][1] mr
n, m = map(int, input().split())
k = [list(map(int, input().split())) for _ in range(n)]

sum = 0
mr = 0
ks = sorted(k)

for i in range(n):
    if ks[i][1] < (m-mr):
        sum += ks[i][0] * ks[i][1]
        mr += ks[i][1]

    else:
        sum += ks[i][0] * (m - mr)
        break

print(sum)