fun main(args : Array<String>){
    val(N_,M) = readLine()!!.split(" ").map(String::toLong)
    val N = N_.toInt()
    var ab_ = Array(N){ readLine()!!.split(" ").map(String::toLong).toTypedArray()}
    ab_.sortBy{it[0]}
    var Mnow = M
    var ans:Long = 0
    var abindex = 0
//    for(i in 0 until ab_.size){
//        println("${ab_[i][0]} ${ab_[i][1]}")
//    }
    while(Mnow>0 && abindex < N){
        var(a,b) = ab_[abindex]
        if(Mnow > b){
            Mnow -= b
            ans += a*b
        }else{
            ans += Mnow*a
            Mnow = 0
            break
        }
        abindex++
    }
    if(Mnow>0){
        throw Exception()
    }else{
        println(ans)
    }
}
