N,M = readline.chomp.split.map(&:to_i)

ary = []
left = M
money = 0
(1..N).each do |i|
  hash = {}
  a,b = readline.chomp.split.map(&:to_i)
  hash['a'] = a
  hash['b'] = b
  ary.push(hash)
end

# p ary

ary.sort_by! {|v| v['a'] }

# p ary

ary.each do |set|
  while((set['a'] > 0) && (set['b'] > 0)) do
    set['b'] -= 1
    left -= 1
    money += set['a']
    # p ary
    break if left == 0
  end
  break if left == 0
end

p money
