N,M = map(int,input().split())
price = [[] for i in range(N)]
for i in range(N):
    a,b = map(int,input().split())
    price[i] = [a,b]
price.sort()
#print(price)
m = 0
money = 0
for i in range(N):
    if m + price[i][1] < M:
        money += price[i][0] * price[i][1]
        m += price[i][1]
    else:
        money += price[i][0] * (M-m)
        break
print(money) N,M = map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split M [] for i in range(N) for i in range(N) i range(N) range N for i in range(N) [] price = [[] for i in range(N)] price [[] for i in range(N)] for i in range(N):
    a,b = map(int,input().split())
    price[i] = [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 price[i] = [a,b] price[i] price i [a,b] a b price.sort() price.sort price sort m = 0 m 0 money = 0 money 0 for i in range(N):
    if m + price[i][1] < M:
        money += price[i][0] * price[i][1]
        m += price[i][1]
    else:
        money += price[i][0] * (M-m)
        break i range(N) range N if m + price[i][1] < M:
        money += price[i][0] * price[i][1]
        m += price[i][1]
    else:
        money += price[i][0] * (M-m)
        break m + price[i][1] < M m + price[i][1] m price[i][1] [i] price i 1 M money += price[i][0] * price[i][1] money price[i][0] * price[i][1] price[i][0] [i] price i 0 price[i][1] [i] price i 1 m += price[i][1] m price[i][1] [i] price i 1 money += price[i][0] * (M-m) money price[i][0] * (M-m) price[i][0] [i] price i 0 M-m M m break print(money) print money m += price[i][1] price[i][1] m price = [[] for i in range(N)] [[] for i in range(N)] price money += price[i][0] * price[i][1] price[i][0] * price[i][1] money M = map(int,input().split()) map(int,input().split()) M N,M = map(int,input().split()) map(int,input().split()) N money += price[i][0] * (M-m) price[i][0] * (M-m) money b = map(int,input().split()) map(int,input().split()) b m = 0 0 m a,b = map(int,input().split()) map(int,input().split()) a money = 0 0 money
N,M = map(int,input().split())
price = [[] for i in range(N)]
for i in range(N):
    a,b = map(int,input().split())
    price[i] = [a,b]
price.sort()
#print(price)
m = 0
money = 0
for i in range(N):
    if m + price[i][1] < M:
        money += price[i][0] * price[i][1]
        m += price[i][1]
    else:
        money += price[i][0] * (M-m)
        break
print(money)
