
import scala.collection.mutable.ArrayBuffer
import scala.io


object sandbox {
  def main(args: Array[String]) = {
    val input = for (line <- io.Source.stdin.getLines) yield {
      val numAry = line.split(' ').map(_.toInt)
      numAry
    }

    val NM = input.next()
    val N = NM(0)
    val M = NM(1)

    val ABarr = ArrayBuffer.empty[Array[Int]]
    while (input.hasNext) {
      ABarr.append(input.next)
    }

    var count = 0
    var sumPrice = 0
    val sortedArr = ABarr.map {
      elem => (elem(0), elem(1))
    }.sortBy {
      case (price, num) => -1 * price
    }
      
    var i = 0
    while(count > M){
      val (price, num) = sortedArr(i)

      if(count + num > M){
        println(sumPrice + price * (M - count))
        count += num
      }else{
        sumPrice += sumPrice
        count += num
      }
    }

  }
}