def inpl(): return list(map(int, input().split()))
N, M = inpl()
X = sorted([inpl() for _ in range(N)], key=lambda x: -x[0])
ans = 0
while M:
    a, b = X.pop()
    buy = min(M, b)
    ans += a*buy
    M -= buy
print(ans) def inpl(): return list(map(int, input().split())) inpl N, M = inpl() N inpl() inpl M inpl() for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) inpl() inpl X = sorted([inpl() for _ in range(N)], key=lambda x: -x[0]) X sorted([inpl() for _ in range(N)], key=lambda x: -x[0]) sorted [inpl() for _ in range(N)] key=lambda x: -x[0] key lambda x: -x[0] -x[0] x[0] x 0 x ans = 0 ans 0 while M:
    a, b = X.pop()
    buy = min(M, b)
    ans += a*buy
    M -= buy M a, b = X.pop() a X.pop() X.pop X pop b buy = min(M, b) buy min(M, b) min M b ans += a*buy ans a*buy a buy M -= buy M buy print(ans) print ans M = inpl() inpl() M N, M = inpl() inpl() N buy = min(M, b) min(M, b) buy M -= buy buy M ans += a*buy a*buy ans def inpl(): return list(map(int, input().split())) def inpl(): return list(map(int, input().split())) inpl a, b = X.pop() X.pop() a ans = 0 0 ans b = X.pop() X.pop() b X = sorted([inpl() for _ in range(N)], key=lambda x: -x[0]) sorted([inpl() for _ in range(N)], key=lambda x: -x[0]) X
def inpl(): return list(map(int, input().split()))
N, M = inpl()
X = sorted([inpl() for _ in range(N)], key=lambda x: -x[0])
ans = 0
while M:
    a, b = X.pop()
    buy = min(M, b)
    ans += a*buy
    M -= buy
print(ans)