object Main{
	def main(A:Array[String]){
		val s = new java.util.Scanner(System.in)
		val n = s.nextInt
		var m = s.nextLong
		val a = Array.fill(n)((s.nextLong,s.nextLong)).sortBy(o => o _1)
		var r = 0L
		for(o <- a) {
			val v = math.min(o._2,m)
			r += o._1 * v
			m -= v
		}
		println(r)
	}
}
