N, M = map(int, input().split())
line = [list(map(int, input().split())) for _ in range(N)]
line.sort()
price = 0
for i in line:
    if M - i[1] > 0:
        price += i[0] * i[1]
        M = M - i[1]
    elif M - i[1] == 0:
        price += i[0] * i[1]
        break
    else:
        number = i[1] - abs(M - i[1])
        price += i[0] * number
        break
print(price) 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 line = [list(map(int, input().split())) for _ in range(N)] line [list(map(int, input().split())) for _ in range(N)] line.sort() line.sort line sort price = 0 price 0 for i in line:
    if M - i[1] > 0:
        price += i[0] * i[1]
        M = M - i[1]
    elif M - i[1] == 0:
        price += i[0] * i[1]
        break
    else:
        number = i[1] - abs(M - i[1])
        price += i[0] * number
        break i line if M - i[1] > 0:
        price += i[0] * i[1]
        M = M - i[1]
    elif M - i[1] == 0:
        price += i[0] * i[1]
        break
    else:
        number = i[1] - abs(M - i[1])
        price += i[0] * number
        break M - i[1] > 0 M - i[1] M i[1] i 1 0 price += i[0] * i[1] price i[0] * i[1] i[0] i 0 i[1] i 1 M = M - i[1] M M - i[1] M i[1] i 1 elif M - i[1] == 0:
        price += i[0] * i[1]
        break
     M - i[1] == 0 M - i[1] M i[1] i 1 0 price += i[0] * i[1] price i[0] * i[1] i[0] i 0 i[1] i 1 break number = i[1] - abs(M - i[1]) number i[1] - abs(M - i[1]) i[1] i 1 abs(M - i[1]) abs M - i[1] M i[1] i 1 price += i[0] * number price i[0] * number i[0] i 0 number break print(price) print price M = map(int, input().split()) map(int, input().split()) M price += i[0] * number i[0] * number price price += i[0] * i[1] i[0] * i[1] price M = M - i[1] M - i[1] M N, M = map(int, input().split()) map(int, input().split()) N price = 0 0 price price += i[0] * i[1] i[0] * i[1] price line = [list(map(int, input().split())) for _ in range(N)] [list(map(int, input().split())) for _ in range(N)] line number = i[1] - abs(M - i[1]) i[1] - abs(M - i[1]) number
N, M = map(int, input().split())
line = [list(map(int, input().split())) for _ in range(N)]
line.sort()
price = 0
for i in line:
    if M - i[1] > 0:
        price += i[0] * i[1]
        M = M - i[1]
    elif M - i[1] == 0:
        price += i[0] * i[1]
        break
    else:
        number = i[1] - abs(M - i[1])
        price += i[0] * number
        break
print(price)