n, m = gets.split.map(&:to_i)
ab = []
n.times do
  ab.push gets.split.map(&:to_i)
end
sorted_ab = ab.sort_by { |e| e.first }
sum = 0
count = 0
sorted_ab.each do |sab|
  sum += sab[0] * sab[1]
  count += sab[1]
  if count >= m
    sum -= sab[0] * sab[1]
    count -= sab[1]
    c = m - count
    puts sum + c * sab[0]
    exit
  end
end
