n,m = gets.split.map(&:to_i)
arr = []
n.times do
  arr << gets.split.map(&:to_i)
end
stores = arr.sort_by(&:first)

ans = 0
sum = 0
stores.each do |str|
  until str[1] == 0 || sum == m
    ans += str[0]
    str[1] -= 1
    sum += 1
  end
end

puts ans
