def ints
  gets.split.map(&:to_i)
end

N, M = ints
ab = []
N.times do
  ab << ints
end

ab.sort! {|x, y| x[0] <=> y[0] }

i = 0
cost = 0
m = 0
while m < M
  bm = [ab[i][1], M - m].min
  cost += ab[i][0] * bm
  m += bm

  i += 1
end

puts cost
