import scala.io.StdIn._

object Main extends App {

  val Array(n,m) = readLine().split(" ").map(_.toInt)
  val AB = Array.fill(n)(readLine().split(" ").map(_.toLong))

  def solve() = {
    var drinks = 0L
    var spend = 0L
    val sortedAB = AB.sortBy(list => list(0))
    sortedAB.foreach { list =>
      if(drinks < m) {
        val price = list(0)
        val stock = list(1)
        val buyCnt = Math.min(m-drinks, stock)
        spend += buyCnt * price
        drinks += buyCnt
      }
    }
    spend
  }
  println(solve())

}

