import scala.io.StdIn

object Main {

  case class Shop(cost: Long, store: Long)

  def main(args: Array[String]): Unit = {

    val Array(n, m) = StdIn.readLine().split(' ').map(_.toInt)
    val abs = (1 to n).foldLeft(Vector.empty[Shop]){(v, _) =>
      val Array(a, b) = StdIn.readLine().split(' ').map(_.toInt)
      v :+ Shop(a, b)
    }

    val costSorted: Vector[Shop] = abs.sortBy(_.cost)
    val ans: Long = costSorted.foldLeft((0l, 0l))((acc, shop) =>
      if (acc._2 >= m) {
        acc
      } else if (acc._2 + shop.store >= m) {
        (acc._1 + (m - acc._2) * shop.cost, m)
      } else {
        (acc._1 + shop.store * shop.cost, acc._2 + shop.store)
      })._1
    println(ans)
  }

}
