N, M= gets.split(" ").map(&:to_i)
A = Array.new(N)
B = Array.new(N)

N.times do |n|
  A[n], B[n] = gets.split(" ").map(&:to_i)
end

max_A = A.max
cost = 0
drink_num = 0

N.times do |n|
  min_A = A.min
  max_can_buy = B[A.index(min_A)]
  if drink_num + max_can_buy <= M
    drink_num += max_can_buy
    cost += min_A * max_can_buy
    A[A.index(min_A)] = max_A
  else
    cost += min_A * (M - drink_num)
    break
  end
end
puts cost
    