n,m = gets.split.map(&:to_i)
shop = n.times.map{gets.split.map(&:to_i)}.sort{|a,b| a[0] <=> b[0]}

ans = 0
drink = 0
shop.each do |a,b|
  if drink+b <= m
    ans += a * b
    drink += b
  else
    ans += a * (m-drink)
    drink = m
  end
  if drink == m
    break
  end
end

puts ans