shop_num, want_drink_num = STDIN.gets.split.map(&:to_i)

cost_index = Hash.new {|h, k| h[k] = []}
buyables = []
shop_num.times do |i|
  cost, buyable = STDIN.gets.split.map(&:to_i)
  cost_index[cost] << i
  buyables << buyable
end

payment = 0

def get_buy_num(buyable, surplus)
  return buyable if surplus > buyable
  surplus
end

cost_index.sort.each do |cost, idxs|
  idxs.each do |i|
    buy_num = get_buy_num(buyables[i], want_drink_num)
  	payment += cost * buy_num
    want_drink_num -= buy_num
    break if want_drink_num == 0
  end
end

STDOUT.puts payment