#include using namespace std; int main() { long N, ans = 0; cin >> N; for (long i = 1; i * i <= N; ++i) { if (0 == N % i) { ans += N / i; if (N / i != i) ans += i; } } cout << ans; }