# p [2,4,6,4,9,1].max

N, M = gets.split().map(&:to_i)
A, B = [], []
N.times do
  a, b = gets.split().map(&:to_i)
  A << a
  B << b
end

p A
p B

while true
	bottle = 0
	price = 0
  i = A.index(A.min)
	if bottle + B[i] >= M
		# bottle += M - B[i]
		price = M - bottle * B[i]
		break
	else
		bottle += B[i]
		price += A[i] * B[i]
		A.delete_at(i)
		B.delete_at(i)
	end
end

p price