n,m = gets.chomp.split(' ').map(&:to_i)
a = readlines.map{|line| line.chomp.split(' ').map(&:to_i)}.sort_by{|x| x[0]}
price = 0
a.each do |y|
  break if m == 0
  price += [y[1],m].min * y[0]
  m -= [y[1],m].min
end
puts price