n,m = gets.chop.split(" ").map(&:to_i)
array = Array.new(n, Array.new(2))
n.times do |i|
    array[i] = gets.split(" ").map(&:to_i)
end
array.sort! {|a,b| a[0] <=> b[0]}
sum = 0
array.each do |a|
    m -= a[1]
    sum += a[1] * a[0]
    if m<0 then sum -= m.abs * a[0]; break end
end
puts sum