fun main(args: Array<String>) {
    abc121c()
}

private data class Shop(val price: Long, val stock: Long)

fun abc121c() {
    val (n, m) = readLine()!!.split(" ").map { it.toLong() }
    val shopList = (1..n).map { readLine()!!.split(" ").map { it.toLong() } }
        .map { Shop(it[0], it[1]) }

    val sortedShopList = shopList.sortedBy { it.price }

    var remain = m
    var answer = 0L
    for (shop in sortedShopList) {
        if (remain <= 0) break
        val buyItems = Math.min(remain, shop.stock)
        remain -= buyItems
        answer += shop.price * buyItems
    }

    println(answer)
}
