import numpy as np
n,m = map(int, input().split())
A = np.array([list(map(int, input().split())) for _ in range(n)], dtype='int64')
ind = np.argsort(A[:,0])
A = A[ind]
num = 0
money = 0
for a,b in A:
    num += b
    if num < m:
        money += a * b
    else:
        money += a * (b - (num - m))
        break
print(money) import numpy as np numpy 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 A = np.array([list(map(int, input().split())) for _ in range(n)], dtype='int64') A np.array([list(map(int, input().split())) for _ in range(n)], dtype='int64') np.array np array [list(map(int, input().split())) for _ in range(n)] dtype='int64' dtype 'int64' ind = np.argsort(A[:,0]) ind np.argsort(A[:,0]) np.argsort np argsort A[:,0] A : A = A[ind] A A[ind] A ind num = 0 num 0 money = 0 money 0 for a,b in A:
    num += b
    if num < m:
        money += a * b
    else:
        money += a * (b - (num - m))
        break a b A num += b num b if num < m:
        money += a * b
    else:
        money += a * (b - (num - m))
        break num < m num m money += a * b money a * b a b money += a * (b - (num - m)) money a * (b - (num - m)) a b - (num - m) b num - m num m break print(money) print money money += a * (b - (num - m)) a * (b - (num - m)) money num += b b num num = 0 0 num money = 0 0 money money += a * b a * b money A = A[ind] A[ind] A ind = np.argsort(A[:,0]) np.argsort(A[:,0]) ind n,m = map(int, input().split()) map(int, input().split()) n A = np.array([list(map(int, input().split())) for _ in range(n)], dtype='int64') np.array([list(map(int, input().split())) for _ in range(n)], dtype='int64') A m = map(int, input().split()) map(int, input().split()) m
import numpy as np
n,m = map(int, input().split())
A = np.array([list(map(int, input().split())) for _ in range(n)], dtype='int64')
ind = np.argsort(A[:,0])
A = A[ind]
num = 0
money = 0
for a,b in A:
    num += b
    if num < m:
        money += a * b
    else:
        money += a * (b - (num - m))
        break
print(money)