#include using namespace std; #define rep(i, m, n) for (int i = m; i < n; ++i) int main() { long long N; cin >> N; using P = pair; vector

A; for(long long i = 2; i * i <= N; ++i) { int cnt = 0; while(N % i == 0) { N /= i; cnt++; } if(cnt) A.push_back(make_pair(i, cnt)); } if(N != 1) A.push_back(make_pair(N, 1)); long long ans = 1; for(auto p : A) { long long a = (pow(p.first, p.second + 1) - 1) / (p.first - 1); ans *= a; } cout << ans << '\n'; return 0; }