n, m = gets.split.map &:to_i # m本飲みたい
arr = []
n.times do
  arr << gets.split.map(&:to_i)
  # 金額、限度
end
arr.sort! { |a, b| a[0] != b[0] ? a[0] <=> b[0] : -(a[1] <=> b[1]) }
# 安い順、たくさん買える順
count = 0
price = 0
arr.each do |ar|
  until count == m || ar[1].zero?
    price += ar[0]
    count += 1
    ar[1] -= 1
  end
end
p price

# 12
# 130
# 100000000000000
