lines = []
while line = gets
    lines << line.chomp.split(' ').map(&:to_i)
end

N = lines[0][0]
M = lines[0][1]
Inf = 10 ** 10

price_num = []
for i in 1..N do
  price_num[i-1] = lines[i][0] * Inf + lines[i][1]
end
price_num.sort!

num_drink = 0
sum_price = 0
i = 1
while num_drink < M do
  price = price_num[i-1] / Inf
  num = price_num[i-1] % Inf
  if M - num_drink > num then
    num_drink += num
    sum_price += price * num
  else
    sum_price += price * (M - num_drink)
    num_drink += M - num_drink
  end
  i += 1
end
puts sum_price