#include #include using namespace std; unsigned long long sumofx(unsigned long long a); int main() { unsigned long long n; cin >> n; cout << sumofx(n % 2 ? n : n / 2) << endl; return 0; } unsigned long long sumofx(unsigned long long a) { unsigned long long ans=1, b=1, c=0,i; while (a % 2 == 0) { c++; b = b + pow(2, c); a /= 2; } ans *= b; for (i = 3; i <= sqrt(a); i+=2) { b = 1; c = 0; while (a%i == 0) { c++; b = b + pow(i, c); a /= i; } ans *= b; } if (a != 1)ans *= a + 1; return ans; }