object Main {

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)

    // 安い順に買った方がいい
    val N, M = sc.nextInt()
    val AB = (0 until N). map { _ => // 安い順に並べたA, B
      val A = sc.nextLong()
      val B = sc.nextInt()
      (A, B)
    }. sortBy (_._1). toArray

    var count = 0 // 買った本数
    var sum = 0L // 費やした金額
    def buyAt(i: Int): Unit = {
      val (a, b) = AB(i)
      val currentN = Math.min(M - count, b)
      count += currentN
      sum += a * currentN
      if (count == M) {}
      else buyAt(i+1)
    }
    buyAt(0)
    println(sum)
  }

}