N, M = gets.split.map(&:to_i)
x = []
count = 0
sum = 0

N.times do
  x << gets.split.map(&:to_i)
end

x.sort_by!{|i| i[0]}

x.each do |a, b|
  if count + b >= M
    sum += a * (M - count)
    break
  else
    sum += a * b
    count += b
  end
end

puts sum