N , M = gets.split.map{|i| i.to_i}
input = Array.new(N).map{Array.new(2)}

N.times do |i|
    input[i] = gets.split.map{|i| i.to_i}
end

input.sort!{|a , b| a[0] <=>b[0]}

i = 0
k = 0
min = 0
while k != M
    if input[i][1] == 0
        i += 1
    end

    k += 1
    min += input[i][0]
    input[i][1] -= 1
end

puts min