private fun readLongs() = readLine()!!.split(" ").map { it.toLong() }

fun main(args: Array<String>) {
    val (N, M) = readLongs()
    val ab = Array(N.toInt()) { readLongs() }

    var need = M
    var ans = 0L
    for ((price, amount) in ab.sortedBy { it[0] }) {
        if (amount < need) {
            ans += price * amount
            need -= amount
        } else {
            ans += price * need
            break
        }
    }

    println(ans)
}