while line = gets() and line != "0 0\n"
	n, m = line.chop.split(" ").map{|num| num.to_i}
	pd = []
	n.times do
		pd << gets.chop.split(" ").map{|num| num.to_i}.reverse
	end
	pd.sort!
	while pd.size > 0 and m >= pd[-1][1]
		m -= pd[-1][1]
		pd.pop
	end
	if pd.size == 0
		p 0
	else
		pd[-1][1] -= m
		result = 0
		for i in 0..pd.size - 1
			result += pd[i][0] * pd[i][1]
		end
		p result
	end
end