object Main {

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    val N, M = sc.nextInt
    val shop = new Array[(Long, Long)](N)
    for (i <- 0 until N) {
      shop(i) = (sc.nextLong, sc.nextLong())
    }
    val sorted = shop.sortBy(_._1)
    var rest: Long = M
    var result = 0L

    def buy(): Unit = {
      for (shop <- sorted) {
        val (price, count) = shop
        if (rest < count) {
          result += rest * price
          return
        } else {
          result += count * price
          rest -= count
        }
      }
    }

    buy()
    println(result)
  }
}