#include "bits/stdc++.h" using namespace std; #define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i)) #define rep(i,j) FOR(i,0,j) #define each(x,y) for(auto &(x):(y)) #define mp make_pair #define all(x) (x).begin(),(x).end() #define debug(x) cout<<#x<<": "<<(x)< pii; typedef vector vi; typedef vector vll; ll N; int main(){ while(cin >> N){ ll ans = 0; if(N % 2 == 0)N /= 2; for(ll i = 1; i*i <= N; ++i){ if(N%i == 0){ ans += i; ll j = N / i; if(i != j)ans += j; } } cout << ans << endl; } }