object Main {

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    val N, M = sc.nextInt()
    val ABs = Array.fill(N, 2)(sc.nextInt())
    val s = ABs.sortBy(_.head)
    println(s.foldLeft((0, M)) {
      case ((acc, m), arr) if m == 0 =>
        (acc, 0)
      case ((acc, m), arr) =>
        val a = arr.head
        val b = arr.last
        val buy = Math.min(m, b)
        (acc + (a * buy), m - buy)
    }._2)
  }
}
