n, m = gets.split.map(&:to_i)
# as = Array.new(n)
# bs = Array.new(n)
abs = Array.new(n)
n.times do |i|
  # as[i], bs[i] = gets.split.map(&:to_i)
  abs[i] = gets.split.map(&:to_i)
end

abs.sort! {|(a1,b1),(a2,b2)| a1<=>a2}

# puts abs.inspect
ans = 0
abs.each do |a, b|
  buyc = [m, b].min
  m -= buyc
  ans += buyc * a
  if m == 0
    break
  end
end
puts ans
