object Main extends App {
  val Array(n,m) = io.StdIn.readLine.split(' ').map(_.toInt)

  val abs = (for (i <- 1 to n) yield io.StdIn.readLine.split(' ').map(_.toInt)).sortWith((ab0,ab1) => ab0(0) < ab1(0))

  var bought = 0
  var budget = 0L
  var i = 0

  while (bought < m) {
    if (bought + abs(i)(1) <= m) {
      bought += abs(i)(1)
      budget += abs(i)(1)*abs(i)(0).toLong
    } else if (bought + abs(i)(1) > m) {
      val necessary = m - bought
      bought += necessary
      budget += necessary*abs(i)(0).toLong
    }
    i += 1
  }

  val out = budget

  println(out)
}
