n, m = gets.chomp.split(" ").map(&:to_i)
arr = []

n.times do |i|
  arr.push(gets.chomp.split(" ").map(&:to_i))
end
arr.sort_by!{|a, _| a}

total = 0
arr.each do |a, b|
  count = [b, m].min
  total += count * a
  m -= count
  break if m <= 0
end

puts total
