private val map = LinkedHashMap<Long, Long>()

fun main() {
    val (n, m) = readLine()!!.split(" ").map { it.toLong() }
    repeat(n.toInt()) { _ ->
        val (a, b) = readLine()!!.split(" ").map { it.toLong() }
        map[a] = (map[a] ?: 0) + b
    }

    var count = m
    var result = 0L
    map.toSortedMap().forEach {
        val index = it.key
        val i = it.value

        val take = if (i <= count) {
            i
        } else {
            count
        }
        result += take * index
        count -= take
        if (count == 0L) {
            println(result)
            return
        }
    }
}