N,M = [int(i) for i in input().split()]
store = [[int(i) for i in input().split()] for j in range(N)]
store.sort()
tc = 0
for i in range(N):
    tc += min(store[i][1], M) * store[i][0]
    M -= store[i][1]
    if M <= 0:
        break
print(tc) int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i N,M = [int(i) for i in input().split()] N [int(i) for i in input().split()] M [int(i) for i in input().split()] for j in range(N) for j in range(N) j range(N) range N for j in range(N) [int(i) for i in input().split()] store = [[int(i) for i in input().split()] for j in range(N)] store [[int(i) for i in input().split()] for j in range(N)] store.sort() store.sort store sort tc = 0 tc 0 for i in range(N):
    tc += min(store[i][1], M) * store[i][0]
    M -= store[i][1]
    if M <= 0:
        break i range(N) range N tc += min(store[i][1], M) * store[i][0] tc min(store[i][1], M) * store[i][0] min(store[i][1], M) min store[i][1] [i] store i 1 M store[i][0] [i] store i 0 M -= store[i][1] M store[i][1] [i] store i 1 if M <= 0:
        break M <= 0 M 0 break print(tc) print tc tc += min(store[i][1], M) * store[i][0] min(store[i][1], M) * store[i][0] tc M = [int(i) for i in input().split()] [int(i) for i in input().split()] M tc = 0 0 tc M -= store[i][1] store[i][1] M store = [[int(i) for i in input().split()] for j in range(N)] [[int(i) for i in input().split()] for j in range(N)] store N,M = [int(i) for i in input().split()] [int(i) for i in input().split()] N
N,M = [int(i) for i in input().split()]
store = [[int(i) for i in input().split()] for j in range(N)]
store.sort()
tc = 0
for i in range(N):
    tc += min(store[i][1], M) * store[i][0]
    M -= store[i][1]
    if M <= 0:
        break
print(tc)