#include #include #include #include #include #include #include #include #include #include static const int MOD = 1000000007; using ll = long long; using u32 = uint32_t; using namespace std; template constexpr T INF = ::numeric_limits::max()/32*15+208; template vector divisor(T n){ vector ret; for(T i = 1; i * i <= n; i++) { if(n % i == 0) { ret.push_back(i); if(i * i != n) ret.push_back(n / i); } } sort(begin(ret), end(ret)); return(ret); } int main() { ll n; cin >> n; auto v = divisor(n); ll ans = accumulate(v.begin(),v.end(), 0LL); cout << ans << "\n"; return 0; }