n, m = gets.chomp.split(' ').map(&:to_i)
shops = []
n.times { |i| shops << gets.chomp.split(' ').map(&:to_i) }
num = 0
money = 0

shops.sort_by { |s| s[0] }.each do |shop|
  shop[1].times do |i|
    money += shop[0]
    num += 1
    break if num == m
  end
  break if num == m
end

puts money