n, m = gets.split.map(&:to_i)
abs = n.times.map do
  gets.split.map(&:to_i)
end

sum = 0
count = 0
abs.sort_by{|a, b| a }.each do |a, b|
  count += b
  if count > m
    sum += a * (b + m - count)
  else
    sum += a * b
  end
  break if count > m
end

puts sum
