import java.util.Scanner


object Main {
  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val n, m = sc.nextInt()

    val ab = new Array[(Int, Int)](n)
    for (i <- ab.indices) {
      ab(i) = (sc.nextInt(), sc.nextInt())
    }

    val abab = ab.sortBy(_._1)

    var ans = 0L
    var acc = 0L

    for (i <- abab.indices) {
      if (abab(i)._2 < m - acc) {
        ans += abab(i)._1 * abab(i)._2
        acc += abab(i)._2
      } else {
        val mi = math.min(abab(i)._2, m - acc)
        ans += mi * abab(i)._1
      }
    }

    println(ans)
  }
}