#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 - 1) / (p -> first - 1) + p -> second;
}
cout << sumOfDivisors;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bWFwPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgbWFpbiAoKQp7CiAgICBsb25nIGxvbmcgbiwgc3VtT2ZEaXZpc29ycyA9IDE7CiAgICBjaW4gPj4gbjsKICAgIG1hcDxsb25nIGxvbmcsIGxvbmcgbG9uZz4gcHJpbWVEaXZJblBvdzsKICAgIGZvcihsb25nIGxvbmcgaSA9IDI7IGkgKiBpIDw9IG47IGkrKyl7CiAgICAgICAgd2hpbGUobiAlIGkgPT0gMCl7CiAgICAgICAgICAgIGlmKHByaW1lRGl2SW5Qb3cuZmluZChpKSA9PSBwcmltZURpdkluUG93LmVuZCgpKXsKICAgICAgICAgICAgICAgIHByaW1lRGl2SW5Qb3dbaV0gPSAxOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHByaW1lRGl2SW5Qb3dbaV0gKj0gaTsKICAgICAgICAgICAgbiAvPSBpOwogICAgICAgIH0KICAgIH0KICAgIGlmKG4gIT0gMSl7CiAgICAgICAgcHJpbWVEaXZJblBvd1tuXSA9IG47CiAgICB9CiAgICBmb3IobWFwPGxvbmcgbG9uZywgbG9uZyBsb25nPjo6aXRlcmF0b3IgcCA9IHByaW1lRGl2SW5Qb3cuYmVnaW4oKTsgcCAhPSBwcmltZURpdkluUG93LmVuZCgpOyBwKyspewogICAgICAgIHN1bU9mRGl2aXNvcnMgKj0gKHAgLT4gc2Vjb25kIC0gMSkgLyAocCAtPiBmaXJzdCAtIDEpICsgcCAtPiBzZWNvbmQ7CiAgICB9CiAgICBjb3V0IDw8IHN1bU9mRGl2aXNvcnM7CiAgICByZXR1cm4gMDsKfQ==