N, M = gets.split.map(&:to_i)
arr = []
N.times do
  arr << gets.split.map(&:to_i)
end
arr.sort!{|arr1, arr2| arr1[0] <=> arr2[0]}
m = 0
price = 0
loop do
  a, b = arr.shift
  if b + m >= M
    price += (M - m) * a
    break
  else
    price += a * b
    m += b
  end
end
puts price