n, m = gets.strip.split(" ").map(&:to_i)
shop = Array.new(n) do
  gets.strip.split(" ").map(&:to_i)
end

shop.sort_by!(&:first)

b = 0
ans = 0
l = shop.size - 1
0.upto(l) do |i|
  c = [m - b, shop[i].last].min
  b += c
  ans += c * shop[i].first
   
  break if b == m
end

puts ans
