N, M = gets.split.map(&:to_i)
ab = N.times.map { gets.split.map(&:to_i) }

A = 0
B = 1

ab.sort_by! { |ab| ab[A] }

m = M
ans = 0
ab.each do |ab|
  buy = [m, ab[B]].min
  ans += buy * ab[A]
  m -= buy
  if buy <= 0
    break
  end
end

puts ans
