fun main(args: Array<String>) = println(run {
    val(n,m) = readLine()!!.split(" ").map { it.toInt() }
    val ab = (1..n).map { readLine()!!.split(" ").map { it.toLong() } }.sortedBy { it[0] }

    var price = 0L
    var count = 0L
    for (i in 0..n-1) {
        val (a, b) = ab[i]
        val purchase = Math.min(b, m-count)
        count += purchase
        price += a * purchase
        if(count == m.toLong()) return@run price
    }
    price
})