#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define rep(x, to) for (int x = 0; x < (to); x++) #define REP(x, a, to) for (int x = (a); x < (to); x++) #define foreach(itr, x) for (typeof((x).begin()) itr = (x).begin(); itr != (x).end(); itr++) #define EPS (1e-14) using namespace std; typedef long long ll; typedef pair PII; typedef pair PLL; typedef complex Complex; typedef vector< vector > Mat; ll N; ll ans = 1; void solve(ll x) { for (ll i = 2; i * i <= x; i++) { if (x % i != 0) continue; ll power = 1; while (x % i == 0) { power *= i; x /= i; } power *= i; ans *= (power - 1) / (i - 1); } // Nが素数の場合 if (x != 1) { ans *= 1 + x; } cout << ans << endl; } int main() { cin >> N; solve(N % 2 == 0 ? N / 2 : N); return 0; }