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

    var ans = 0L
    var count = 0L
    for(shop in shopList) {
        val buyCount = Math.min(shop[1], (m - count).toLong())
        ans += buyCount*shop[0]
        count += buyCount
        if(count >= m) {
            break
        }
    }
    println(ans)
}
