import java.util.Scanner


object Main {
  val sc = new Scanner(System.in)

  def main(args: Array[String]): Unit = {
    val n = sc.nextInt
    val m = sc.nextInt

    val ab = Vector.fill(n)( (sc.nextLong, sc.nextLong) ).sorted
        .foldLeft(Vector.empty[(Long, Long, Long, Long)]){ case ( res, acc) =>
      val lo = res.lastOption.getOrElse((0L, 0L, 0L, 0L))
          res :+ (acc._1, acc._2, lo._3 + acc._2, lo._4 + acc._1 * acc._2)
        }

    val dataTuple = ab.find(_._3 >= m).get

    val result = dataTuple._4 - dataTuple._1 * ( dataTuple._3 - m)

//    println(ab)
//    println(dataTuple)
    println(result)
  }
}