N, M = gets.split.map(&:to_i)
D = N.times.map { gets.split.map(&:to_i) }.sort_by(&:first)

total_item = 0
total_pay = 0

D.find do |price, max_item|
  
  if total_item + max_item < M
    total_pay += max_item * price
    total_item += max_item
    false
  else
    item = M - total_item
    total_pay += item * price
    total_item += item
    true
  end
end

puts total_pay