n, m = map(int,input().split())
store = [list(map(int,input().split())) for _ in range(n)]
store = sorted(store, key=lambda x: x[0])

i = 0
ans = 0
while True:
    if store[i][1] < m:
        ans += store[i][0]*store[i][1]
        m -= store[i][1]
        i += 1
    else:
        ans += m*store[i][0]
        break
print(ans) 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 store = [list(map(int,input().split())) for _ in range(n)] store [list(map(int,input().split())) for _ in range(n)] store = sorted(store, key=lambda x: x[0]) store sorted(store, key=lambda x: x[0]) sorted store key=lambda x: x[0] key lambda x: x[0] x[0] x 0 x i = 0 i 0 ans = 0 ans 0 while True:
    if store[i][1] < m:
        ans += store[i][0]*store[i][1]
        m -= store[i][1]
        i += 1
    else:
        ans += m*store[i][0]
        break True if store[i][1] < m:
        ans += store[i][0]*store[i][1]
        m -= store[i][1]
        i += 1
    else:
        ans += m*store[i][0]
        break store[i][1] < m store[i][1] [i] store i 1 m ans += store[i][0]*store[i][1] ans store[i][0]*store[i][1] store[i][0] [i] store i 0 store[i][1] [i] store i 1 m -= store[i][1] m store[i][1] [i] store i 1 i += 1 i 1 ans += m*store[i][0] ans m*store[i][0] m store[i][0] [i] store i 0 break print(ans) print ans n, m = map(int,input().split()) map(int,input().split()) n store = [list(map(int,input().split())) for _ in range(n)] [list(map(int,input().split())) for _ in range(n)] store ans = 0 0 ans i += 1 1 i i = 0 0 i ans += store[i][0]*store[i][1] store[i][0]*store[i][1] ans m -= store[i][1] store[i][1] m ans += m*store[i][0] m*store[i][0] ans m = map(int,input().split()) map(int,input().split()) m store = sorted(store, key=lambda x: x[0]) sorted(store, key=lambda x: x[0]) store
n, m = map(int,input().split())
store = [list(map(int,input().split())) for _ in range(n)]
store = sorted(store, key=lambda x: x[0])

i = 0
ans = 0
while True:
    if store[i][1] < m:
        ans += store[i][0]*store[i][1]
        m -= store[i][1]
        i += 1
    else:
        ans += m*store[i][0]
        break
print(ans)
