#include #include using namespace std; using namespace atcoder; using ll = long long; using ld = long double; int main() { ll N; cin >> N; ll sum = 0; for (ll i = 1; i * i <= N; i++) { if (N % i == 0) { sum += i; if (i * i != N) sum += N / i; } } cout << sum << endl; return 0; }