N, M = gets.split.map(&:to_i)
#As = Array.new(2)
#Bs = Array.new(2)

arr = []

d_n = 0
cost = 0


N.times do |i|
  a, b = gets.split.map(&:to_i)
  arr.push([a, b])
end

arr.sort! { |a, b| a[0] <=> b[0] }



N.times do |i|

 if (d_n + arr[i][1] >= M)
   cost += (M - d_n) * arr[i][0]
   break
 end

 d_n += arr[i][1]  
 cost += arr[i][1] * arr[i][0]

end

puts cost