import java.math.BigDecimal
fun main(args: Array<String>) {
    var (N,M) = readLine()!!.split(" ").map(String::toInt)
    var dict = (1..N).map{
            readLine()!!.split(" ").map(String::toLong)
            }.sortedBy{it[0]}

    var ans = 0L
    var cnt = M.toLong()
    for(i in 0..N-1){
        if(cnt == 0L) break
        var (a,b) = dict[i]
        ans += a * Math.min(b,cnt)
        cnt = Math.max(cnt-b,0)
    }
    println(ans)
   
}
