object Main extends App {
  import scala.io.StdIn._

  val Array(n, m) = readLine.trim.split(' ').map(_.toInt)
  val store = Array.tabulate(n){_ ⇒
    val Array(a, b) = readLine.trim.split(' ').map(_.toLong)
    (a, b)
  }.sortBy(_._1)
  println(
    buyM(m, store.toList)
  )

  def buyM(m: Int, store: List[(Long, Long)]): Long = {
    def sub(rest: Long, store: List[(Long, Long)], result: Long = 0): Long = {
      store match {
        case (a, b)::_ if b >= rest ⇒ result + a * rest
        case (a, b)::t ⇒ sub(rest - b, t, result + a * b)
        case Nil ⇒ ???
      }
    }
    sub(m, store)
  }

}