from collections import defaultdict

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

n,m = readInts()
ab = [readInts() for i in range(n)]
ab.sort()
i = 0
ans = 0
while m>0:
	if m>=ab[i][1]:
		m-=ab[i][1]
		ans+=ab[i][0]*ab[i][1]
		i+=1
	else:
		ans += m*ab[i][0]
		m = 0
print(ans) from collections import defaultdict def readInt():
	return int(input()) readInt return int(input()) int(input()) int input() input def readInts():
	return list(map(int, input().split())) readInts return list(map(int, input().split())) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def readChar():
	return input() readChar return input() input() input def readChars():
	return input().split() readChars return input().split() input().split() ().split () input split n,m = readInts() n readInts() readInts m readInts() for i in range(n) for i in range(n) i range(n) range n for i in range(n) readInts() readInts ab = [readInts() for i in range(n)] ab [readInts() for i in range(n)] ab.sort() ab.sort ab sort i = 0 i 0 ans = 0 ans 0 while m>0:
	if m>=ab[i][1]:
		m-=ab[i][1]
		ans+=ab[i][0]*ab[i][1]
		i+=1
	else:
		ans += m*ab[i][0]
		m = 0 m>0 m 0 if m>=ab[i][1]:
		m-=ab[i][1]
		ans+=ab[i][0]*ab[i][1]
		i+=1
	else:
		ans += m*ab[i][0]
		m = 0 m>=ab[i][1] m ab[i][1] [i] ab i 1 m-=ab[i][1] m ab[i][1] [i] ab i 1 ans+=ab[i][0]*ab[i][1] ans ab[i][0]*ab[i][1] ab[i][0] [i] ab i 0 ab[i][1] [i] ab i 1 i+=1 i 1 ans += m*ab[i][0] ans m*ab[i][0] m ab[i][0] [i] ab i 0 m = 0 m 0 print(ans) print ans m = 0 0 m ans+=ab[i][0]*ab[i][1] ab[i][0]*ab[i][1] ans def readInts():
	return list(map(int, input().split())) def readInts():
	return list(map(int, input().split())) readInts def readChars():
	return input().split() def readChars():
	return input().split() readChars m = readInts() readInts() m ans = 0 0 ans def readChar():
	return input() def readChar():
	return input() readChar ans += m*ab[i][0] m*ab[i][0] ans ab = [readInts() for i in range(n)] [readInts() for i in range(n)] ab i+=1 1 i i = 0 0 i def readInt():
	return int(input()) def readInt():
	return int(input()) readInt n,m = readInts() readInts() n m-=ab[i][1] ab[i][1] m
from collections import defaultdict

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

n,m = readInts()
ab = [readInts() for i in range(n)]
ab.sort()
i = 0
ans = 0
while m>0:
	if m>=ab[i][1]:
		m-=ab[i][1]
		ans+=ab[i][0]*ab[i][1]
		i+=1
	else:
		ans += m*ab[i][0]
		m = 0
print(ans)