n, m = gets.split.map(&:to_i)
l = Array.new(n) { gets.split.map(&:to_i) }.sort
cost = count = 0

l.each do |a, b|
  count += b
  cost += a * b

  if count >= m
    puts cost - (count - m) * a
    exit
  end
end