#include #include long long s(long long n){ long long ret = 1; for(long long i=2; i*i<=n; i++){ if(n%i != 0) continue; long long tmp = i; while(n%i == 0){ tmp *= i; n /= i; } ret *= (tmp-1)/(i-1); } if(n!=1){ ret *= n+1; } return ret; } int main(){ long long n; std::cin >> n; assert(1<=n && n<=1000000000000); std::cout << (n&1?s(n):s(n/2)) << std::endl; }