object Main {
	val s = new java.util.Scanner(System.in)
	def main(args: Array[String]) {
		while (true) {
			var n, m = s.nextInt
			if (n + m == 0) sys.exit
			var r = 0
			Array.fill(n)(s.nextInt, s.nextInt).sortBy(_._2).reverse.foreach(v => {
				val min = math.min(v._1, m)
				r += (v._1 - min) * v._2
				m -= min
			})
			println(r)
		}
	}
}