object Main extends App {
  
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  var m = sc.nextLong()
  val shops = Array.fill(n)(sc.nextLong() -> sc.nextLong()).sortBy(_._1)
  var ans = 0L
  for(t <- shops) {
    if (t._2 < m) {
      m -= t._2
      ans += t._1 * t._2
    } else if (m != 0 && t._2 >= m) {
      ans += t._1 * m
      m = 0L
    }
  }
  println(ans)
}
