n, m = gets.split.map(&:to_i)
multiple_array = Array.new(n, 0)
n.times do |i|
  multiple_array[i] = gets.split.map(&:to_i)
end

multiple_array.sort_by! { |a, b| a }
ans = 0
buy_sum = 0

multiple_array.each do |a, b|
  buy = 0
  if m >= buy_sum + b
    buy = b
  else
    buy = m - buy_sum
  end
  buy_sum += buy
  ans += a * buy
  break if m == buy_sum
end

puts ans