N, M = gets.split(' ').map(&:to_i)
store = []
count = 0
cost = 0

N.times do |i|
  store.push(gets.split(' ').map(&:to_i))
end

store = store.sort

store.each do |e|
  break if count == M

  if count + e[1] < M
    cost += e[0] * e[1]
    count += e[1]
  else
    cost += e[0] * (M - count)
    count = M
  end
end

puts cost