require "prime" def s(n) n<2?1:Prime.prime_division(n).map {|p, e| (p ** (e + 1) - 1) / (p - 1) }.inject(:*) end puts s(gets.to_i)