#include #include using namespace std; long long sum(map::const_iterator itBegin, map::const_iterator itEnd, long long base) { if (itBegin == itEnd) { return base; } map::const_iterator itNext = itBegin; ++itNext; long long result = 0; long long powered = 1; for (long long i = 0; i <= itBegin->second; ++i) { result += sum(itNext, itEnd, base * powered); powered *= itBegin->first; } return result; } int main(int argc, const char * argv[]) { long long n; cin >> n; map factors; for (long long divider = 2; divider * divider <= n; ++divider) { while (n % divider == 0) { ++factors[divider]; n /= divider; } } if (n != 1) { ++factors[n]; } cout << sum(factors.begin(), factors.end(), 1) << endl; return 0; }