import java.util.*

class Drink(value: Long, count: Long) {
    val value = value
    val count = count
}
fun main(args: Array<String>){
	val cin = Scanner(System.`in`)
    val n = cin.nextInt()
    val m = cin.nextLong()

    val arr: MutableList<Drink> = mutableListOf()

    for (i in 0..n-1) {
        val a = cin.nextLong()
        val b = cin.nextLong()
        arr.add(Drink(a, b))
    }

    arr.sortBy { it.value }

    var sum_value: Long = 0
    var sum_count: Long = 0

    for (i in 0..n-1) {
        val tt = m - (sum_count + arr[i].count)
        if (0 > tt) {
            sum_value += arr[i].value * (m-sum_count)
            break
        }
        sum_count += arr[i].count
        sum_value += arr[i].value * arr[i].count
    }

    println(sum_value)
}