#include <iostream>
#include <map>
using namespace std;
int main ()
{
long long n, sumOfDivisors = 1;
cin >> n;
map<long long, long long> primeDivInPow;
for(long long i = 2; i * i <= n; i++){
while(n % i == 0){
if(primeDivInPow.find(i) == primeDivInPow.end()){
primeDivInPow[i] = 1;
}
primeDivInPow[i] *= i;
n /= i;
}
}
if(n != 1){
primeDivInPow[n] = n;
}
for(map<long long, long long>::iterator p = primeDivInPow.begin(); p != primeDivInPow.end(); p++){
sumOfDivisors *= (p -> second * p -> first - 1) / (p ->first - 1);
}
cout << sumOfDivisors;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bWFwPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgbWFpbiAoKQp7Cglsb25nIGxvbmcgbiwgc3VtT2ZEaXZpc29ycyA9IDE7CgljaW4gPj4gbjsKCW1hcDxsb25nIGxvbmcsIGxvbmcgbG9uZz4gcHJpbWVEaXZJblBvdzsKCWZvcihsb25nIGxvbmcgaSA9IDI7IGkgKiBpIDw9IG47IGkrKyl7CgkJd2hpbGUobiAlIGkgPT0gMCl7CgkJCWlmKHByaW1lRGl2SW5Qb3cuZmluZChpKSA9PSBwcmltZURpdkluUG93LmVuZCgpKXsKCQkJCXByaW1lRGl2SW5Qb3dbaV0gPSAxOwoJCQl9CgkJCXByaW1lRGl2SW5Qb3dbaV0gKj0gaTsKCQkJbiAvPSBpOwoJCX0KCX0KCWlmKG4gIT0gMSl7CgkJcHJpbWVEaXZJblBvd1tuXSA9IG47Cgl9Cglmb3IobWFwPGxvbmcgbG9uZywgbG9uZyBsb25nPjo6aXRlcmF0b3IgcCA9IHByaW1lRGl2SW5Qb3cuYmVnaW4oKTsgcCAhPSBwcmltZURpdkluUG93LmVuZCgpOyBwKyspewoJCXN1bU9mRGl2aXNvcnMgKj0gKHAgLT4gc2Vjb25kICogcCAtPiBmaXJzdCAtIDEpIC8gKHAgLT5maXJzdCAtIDEpOwoJfQoJY291dCA8PCBzdW1PZkRpdmlzb3JzOwoJcmV0dXJuIDA7Cn0=