import scala.io.StdIn._
object Main extends App {
  val Array(n, m) = readLine.split(" ").map(_.toLong)
  val abs = (1 to n.toInt).map { _ =>
    readLine.split(" ").map(_.toLong) match {
      case Array(a, b) => (a, b)
    }
  }

  var r = m
  var res = 0l
  for (ab <- abs.sortBy(_._1) if r > 0) {
    if (r <= ab._2) {
      res = res + ab._1 * r
      r = 0
    } else {
      res = res + ab._1 * ab._2
      r = r - ab._2
    }
  }
  println(res)

}
