n,m = gets.chomp.split(" ").map(&:to_i)

ary = []
cost = 0
nums = 0

n.times do
  ab = gets.chomp.split(" ").map(&:to_i)
  ary.push(ab)
end

ary = ary.sort { |s,t| s[0] <=> t[0] }

i = 0
while nums < m do
  c = 0
  while c < ary[i][1] do
    cost += ary[i][0]
    nums += 1
    c += 1
    break if nums == m
  end
  i += 1
end

p cost
