n, m = gets.split.map(&:to_i)

count = 0
price = 0
shops = n.times.map do
  gets.split.map(&:to_i)
end
shops.sort_by{|a, b| a}.each do |a, b|
  if m > count + b
    price += a * b
    count += b
  else
    price += (m-count)*a
    break
  end
end

puts price