import sys

N, M = map(int, input().split())
shop = []
count = 0
money = 0
for i in range(N):
    a, b = map(int, input().split())
    shop.append([a, b])

shop = list(sorted(shop))

for i in range(N):
    buy = min(M, shop[i][1])
    money += buy * shop[i][0]
    M = M - buy
    if M == 0:
        print(money)
        sys.exit() import sys sys N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M shop = [] shop [] count = 0 count 0 money = 0 money 0 for i in range(N):
    a, b = map(int, input().split())
    shop.append([a, b]) i range(N) range N a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b shop.append([a, b]) shop.append shop append [a, b] a b shop = list(sorted(shop)) shop list(sorted(shop)) list sorted(shop) sorted shop for i in range(N):
    buy = min(M, shop[i][1])
    money += buy * shop[i][0]
    M = M - buy
    if M == 0:
        print(money)
        sys.exit() i range(N) range N buy = min(M, shop[i][1]) buy min(M, shop[i][1]) min M shop[i][1] [i] shop i 1 money += buy * shop[i][0] money buy * shop[i][0] buy shop[i][0] [i] shop i 0 M = M - buy M M - buy M buy if M == 0:
        print(money)
        sys.exit() M == 0 M 0 print(money) print money sys.exit() sys.exit sys exit money = 0 0 money count = 0 0 count M = M - buy M - buy M a, b = map(int, input().split()) map(int, input().split()) a shop = [] [] shop money += buy * shop[i][0] buy * shop[i][0] money N, M = map(int, input().split()) map(int, input().split()) N b = map(int, input().split()) map(int, input().split()) b shop = list(sorted(shop)) list(sorted(shop)) shop buy = min(M, shop[i][1]) min(M, shop[i][1]) buy M = map(int, input().split()) map(int, input().split()) M
import sys

N, M = map(int, input().split())
shop = []
count = 0
money = 0
for i in range(N):
    a, b = map(int, input().split())
    shop.append([a, b])

shop = list(sorted(shop))

for i in range(N):
    buy = min(M, shop[i][1])
    money += buy * shop[i][0]
    M = M - buy
    if M == 0:
        print(money)
        sys.exit()