#include using ll = long long; using namespace std; ll n, ok=0; int main() { cin.tie(0)->sync_with_stdio(0); cin >> n; for(int i=1; i*i<=n; ++i) { if(n%i==0) { ok += i + n/i; } } ll k = sqrt(n); if(k*k == n) {ok -= k;} cout << ok; return 0; }