#include using namespace std; using ll = long long; const int mod = 1e9 + 7; const int inf = (1 << 30) - 1; const ll infll = (1LL << 61) - 1; #define fast() cin.tie(0), ios::sync_with_stdio(false) template vector divisor(T n) { vector divisor; for (T i = 1; i * i <= n; i++) { if (n % i == 0) { divisor.push_back(i); if (i * i != n) divisor.push_back(n / i); } } sort(divisor.begin(), divisor.end()); return divisor; } ll N, ans; int main() { cin >> N; auto d = divisor(N); for (auto &a : d) { ans += a; } cout << ans << endl; }