import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val m = sc.nextInt()
    val t = (1..n).map { Pair(sc.nextLong(), sc.nextLong()) }.sortedBy { it.first }

    var ans = 0L
    var sumB = 0L
    for (i in t.indices) {
        val add = Math.min(t[i].second, m - sumB)
        sumB += add
        ans += add * t[i].first
    }
    println(ans)
}