N, M = map(int, input().split())
store_m = [list(map(int, input().split())) for i in range(N)]
store = sorted(store_m)
buy = 0
cost = 0
for i in range(N):
    buy += store[i][1]
    if buy < M:
        cost += store[i][0] * store[i][1]
    else:
        cost += store[i][0] * (M - (buy - store[i][1]))
        print(cost)
        exit() 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 i in range(N) for i in range(N) i range(N) range N for i in range(N) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split store_m = [list(map(int, input().split())) for i in range(N)] store_m [list(map(int, input().split())) for i in range(N)] store = sorted(store_m) store sorted(store_m) sorted store_m buy = 0 buy 0 cost = 0 cost 0 for i in range(N):
    buy += store[i][1]
    if buy < M:
        cost += store[i][0] * store[i][1]
    else:
        cost += store[i][0] * (M - (buy - store[i][1]))
        print(cost)
        exit() i range(N) range N buy += store[i][1] buy store[i][1] [i] store i 1 if buy < M:
        cost += store[i][0] * store[i][1]
    else:
        cost += store[i][0] * (M - (buy - store[i][1]))
        print(cost)
        exit() buy < M buy M cost += store[i][0] * store[i][1] cost store[i][0] * store[i][1] store[i][0] [i] store i 0 store[i][1] [i] store i 1 cost += store[i][0] * (M - (buy - store[i][1])) cost store[i][0] * (M - (buy - store[i][1])) store[i][0] [i] store i 0 M - (buy - store[i][1]) M buy - store[i][1] buy store[i][1] [i] store i 1 print(cost) print cost exit() exit store_m = [list(map(int, input().split())) for i in range(N)] [list(map(int, input().split())) for i in range(N)] store_m M = map(int, input().split()) map(int, input().split()) M cost += store[i][0] * (M - (buy - store[i][1])) store[i][0] * (M - (buy - store[i][1])) cost cost = 0 0 cost N, M = map(int, input().split()) map(int, input().split()) N store = sorted(store_m) sorted(store_m) store buy = 0 0 buy cost += store[i][0] * store[i][1] store[i][0] * store[i][1] cost buy += store[i][1] store[i][1] buy
N, M = map(int, input().split())
store_m = [list(map(int, input().split())) for i in range(N)]
store = sorted(store_m)
buy = 0
cost = 0
for i in range(N):
    buy += store[i][1]
    if buy < M:
        cost += store[i][0] * store[i][1]
    else:
        cost += store[i][0] * (M - (buy - store[i][1]))
        print(cost)
        exit()