object Main extends App {
  @scala.annotation.tailrec
  def loop(store: Seq[(Long, Long)], acc: Long, count: Long): Long = {
    if (count <= 0) acc else store match {
      case Seq() => acc
      case (price, number) :: xs => loop(xs, acc + price * count.min(number), count - number)
    }
  }

  val sc = new java.util.Scanner(System.in)
  val N, M = sc.nextInt()
  println(loop(List.fill(N)(sc.nextLong() -> sc.nextLong()).sortBy(_._1), 0L, M))
}
