#include typedef long long ll; int main(){ ll N, _N; scanf("%lld", &N); _N = N; ll res = 1ll; for(ll i=2;i*i<=N;i++){ ll productSum = 1ll, product = 1ll; while(N % i == 0){ product *= i; productSum += product; N /= i; } res *= productSum; } if(N > 1){res *= 1 + N;} if(_N % 2 == 0){ res -= _N; } printf("%lld\n", res); }