fun main(args: Array<String>) {
    val (N, M) = readLine()!!.split(" ").map(String::toInt)
    val P = Array(N) {
        val (A, B) = readLine()!!.split(" ").map(String::toLong)
        P(A, B)
    }
    P.sortBy { it.A }
    var c = 0L
    var m = 0L
    for (p in P) {
        c += p.A * Math.min(M - m, p.B)
        m += p.B
        if (M <= m) break
    }
    println(c)
}

data class P(val A: Long, val B: Long)