#include #include #include typedef std::int_fast32_t s32; typedef std::uint_fast32_t u32; typedef std::int_fast64_t s64; typedef std::uint_fast64_t u64; const unsigned long mod = 1000000007; const double EPS = 0.00000001; const int INF = (1 << 30); template T pow_(T x, long n) { T p = x; T res = 1; while( n != 0 ) { if( (n & 0x01) != 0 ) { res *= p; } p *= p; n >>= 1; } return res; } long calc2(long p, long n) { long res = 0; for(int i = 0; i <= n; ++i) { res += pow_(p, i); } return res; } long calc(long x) { long res = 1; long limit = sqrt(x) + 1; for(long i = 2; i <= limit; ++i) { int count = 0; while( x % i == 0 ) { count += 1; x /= i; } if( count != 0 ) { res *= calc2(i, count); } } if( x != 0 and x != 1 ) { res *= calc2(x, 1); } return res; } int main() { long n; std::cin >> n; if( n % 2 == 0 ) { std::cout << calc(n/2) << std::endl; } else { std::cout << calc(n) << std::endl; } return 0; }