const val MOD: Long = (1e9+7).toLong()

fun main(args: Array<String>) {
    val (n, m) = readLine()!!.split(" ").map{it.toInt()}
    val x = Array(n, {
        val (a, b) = readLine()!!.split(" ").map{it.toLong()}
        Pair(a, b)
    })
    x.sortBy{ it.first }

    var cnt: Long = 0
    var sum: Long = 0
    for (i in 0 until n) {
        if (cnt + x[i].second < m) {
            cnt += x[i].second
            sum += x[i].first * x[i].second
        } else {
            sum += x[i].first * (m - cnt)
            break
        }
    }
    println(sum)
}
