n,m=gets.split.map(&:to_i)
array=Array.new(n).map{Array.new(2,0)}
n.times do |i|
    a,b=gets.split.map(&:to_i)
    array[i][0]=a
    array[i][1]=b
end

array.sort!
ans=0
count=0
n.times do |i|
    if (count+array[i][1]<m)
        ans+=array[i][0]*array[i][1]
        count+=array[i][1]
    else
        ans+=array[i][0]*(m-count)
        puts ans
        return
    end
end
