import java.util.*

fun main(args: Array<String>) {

    val sc = Scanner(System.`in`)
    val N = sc.nextInt()
    var M = sc.nextInt()
    val AB = Array(N){0L to 0}
    var ans = 0L

    for (i in 0 until N) {
        val A = sc.nextLong()
        val B = sc.nextInt()
        AB[i] = A to B
    }

    AB.sortBy { it.first }

    for ((a,b) in AB) {
        if (M < 0) break
        ans += Math.min(b,M)*a
        M -= b
    }

    //for (ab in AB) println(ab)
    println(ans)
}