case class store(val a: Long, val b: Int)

object Main extends App {
	var Array(n,m) = scala.io.StdIn.readLine.split(" ").map(_.toInt)

	var List = new Array[store](n)

	for(i<-0 until n){
		val Array(tp1, tp2) = scala.io.StdIn.readLine.split(" ")
		List(i) = store(tp1.toLong, tp2.toInt)
	}

	List = List.sortBy(_.a)

	var ans = 0L
	var tq = 0
	while(m > 0){
		val L1 = List(tq).a
		val L2 = List(tq).b

		if( m - L2 > 0){
			m = m - L2
			tq = tq + 1
			ans = ans + L1*L2
		}else{
			ans = ans + L1*m
			m = -1
		}
	}

	println(ans)


}