fun main(args: Array<String>) = yorukatsu19b()

fun yorukatsu19b() {
    val (n, m) = readLine()!!.split(' ').map { it.toInt() }
    data class Shop(val price: Long, val stock: Int)

    val shops = (1..n).map {
        readLine()!!.split(' ').map { it.toInt() }.let { Shop(it[0].toLong(), it[1]) }
    }.sortedBy { it.price }

    var need = m
    var answer = 0L

    for ((price, stock) in shops) {
        if (need <= stock) {
            answer += price * need
            break
        } else {
            answer += price * stock
            need -= stock
        }
    }

    println(answer)
}
