fun main(args: Array<String>) {
    val (N, M) = readLine()!!.split(" ").map { it.toLong() }
    val p = Array (N.toInt()) {
        val l = readLine()!!.split(" ").map { it.toLong() }
        Pair(l[0], l[1])
    }

    p.sortBy {it.first}

    var res = 0L
    var m = M

    for (l in p) {
        if (m <= 0) break

        res += l.first * Math.min(l.second,  m)
        m -= Math.min(l.second, m)
    }

    println(res)
}
