n,m = map(int,input().split())
drink = []
for _ in range(n):
    a,b = map(int,input().split())
    drink.append((a,b))
d = sorted(drink)

ans = 0
x = 0

for t in d:
    if x+t[1] < m:
        ans += t[0]*t[1]
        x += t[1]
    else:
        ans += t[0]*(m-x)
        break

print (ans) n,m = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m drink = [] drink [] for _ in range(n):
    a,b = map(int,input().split())
    drink.append((a,b)) _ range(n) range n a,b = map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b drink.append((a,b)) drink.append drink append (a,b) a b d = sorted(drink) d sorted(drink) sorted drink ans = 0 ans 0 x = 0 x 0 for t in d:
    if x+t[1] < m:
        ans += t[0]*t[1]
        x += t[1]
    else:
        ans += t[0]*(m-x)
        break t d if x+t[1] < m:
        ans += t[0]*t[1]
        x += t[1]
    else:
        ans += t[0]*(m-x)
        break x+t[1] < m x+t[1] x t[1] t 1 m ans += t[0]*t[1] ans t[0]*t[1] t[0] t 0 t[1] t 1 x += t[1] x t[1] t 1 ans += t[0]*(m-x) ans t[0]*(m-x) t[0] t 0 m-x m x break print (ans) print ans a,b = map(int,input().split()) map(int,input().split()) a x += t[1] t[1] x d = sorted(drink) sorted(drink) d b = map(int,input().split()) map(int,input().split()) b ans += t[0]*t[1] t[0]*t[1] ans ans += t[0]*(m-x) t[0]*(m-x) ans x = 0 0 x n,m = map(int,input().split()) map(int,input().split()) n ans = 0 0 ans drink = [] [] drink m = map(int,input().split()) map(int,input().split()) m
n,m = map(int,input().split())
drink = []
for _ in range(n):
    a,b = map(int,input().split())
    drink.append((a,b))
d = sorted(drink)

ans = 0
x = 0

for t in d:
    if x+t[1] < m:
        ans += t[0]*t[1]
        x += t[1]
    else:
        ans += t[0]*(m-x)
        break

print (ans)
