#include #define PI 3.14159265359 using namespace std; const int64_t MOD = 1e9 + 7; int main() { int64_t N; cin >> N; int64_t sum = 0; for (int64_t i = 1; i <= sqrt(N); i++) { if (N % i == 0) { sum += i + (N / i); if (i * i == N) sum -= N / i; } } cout << sum << endl; }