#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <string.h>
using namespace std;
#define all(v) (v.begin()), (v.end())
void fast_io(){
ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
}
int main()
{
fast_io();
long long n=0;
cin >> n;
// prime factorization
long long factorSize = sqrt(n)+1;
long long factors[factorSize] = {0};
while (!(n%2)){
n /= 2;
factors[2]++;
}
for (int i = 3; i <= sqrt(n); i+=2){
if (n%i == 0){
n /= i;
factors[i]++;
}
}
factors[n]++;
/* geometric sequence
- (2^0 + 2^1 + 2^2 + 2^3)
- An = (2)^(n-1)
- Sn = a(r^n - 1)/(r - 1)
// the multiplication of the prime factor's gemetric squence is the formula
//∏k(∑i=0akpik)
For example, the sum of all of the factors of 120=23⋅3⋅5 is
(1+2+22+23)(1+3)(1+5)=15⋅4⋅6=360
*/
long long sum = 1;
for (int i = 0; i < factorSize; i++){
if (factors[i] == 0){continue;}
int n = factors[i]+1;
long long Sn = (pow(i, n) - 1)/(i-1);
sum *= Sn;
}
cout << sum << endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8Y21hdGg+CiNpbmNsdWRlIDxzdGRpby5oPgojaW5jbHVkZSA8c3RyaW5nLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwojZGVmaW5lIGFsbCh2KSAodi5iZWdpbigpKSwgKHYuZW5kKCkpCgp2b2lkIGZhc3RfaW8oKXsKICAgIGlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oZmFsc2UpLCBjaW4udGllKG51bGxwdHIpLCBjb3V0LnRpZShudWxscHRyKTsKfQoKaW50IG1haW4oKQp7CiAgICBmYXN0X2lvKCk7CiAgICBsb25nIGxvbmcgbj0wOwogICAgY2luID4+IG47CiAgICAvLyBwcmltZSBmYWN0b3JpemF0aW9uCiAgICBsb25nIGxvbmcgZmFjdG9yU2l6ZSA9IHNxcnQobikrMTsKICAgIGxvbmcgbG9uZyBmYWN0b3JzW2ZhY3RvclNpemVdID0gezB9OwogICAgd2hpbGUgKCEobiUyKSl7CiAgICAgICAgbiAvPSAyOwogICAgICAgIGZhY3RvcnNbMl0rKzsKICAgIH0KICAgIGZvciAoaW50IGkgPSAzOyBpIDw9IHNxcnQobik7IGkrPTIpewogICAgICAgIGlmIChuJWkgPT0gMCl7CiAgICAgICAgICAgIG4gLz0gaTsKICAgICAgICAgICAgZmFjdG9yc1tpXSsrOwogICAgICAgIH0KICAgIH0KICAgIGZhY3RvcnNbbl0rKzsKCiAgICAvKiBnZW9tZXRyaWMgc2VxdWVuY2UKICAgICAgICAtICgyXjAgKyAyXjEgKyAyXjIgKyAyXjMpCiAgICAgICAgLSBBbiA9ICgyKV4obi0xKQogICAgICAgIC0gU24gPSBhKHJebiAtIDEpLyhyIC0gMSkKCiAgICAvLyB0aGUgbXVsdGlwbGljYXRpb24gb2YgdGhlIHByaW1lIGZhY3RvcidzIGdlbWV0cmljIHNxdWVuY2UgaXMgdGhlIGZvcm11bGEKICAgIC8v4oiPayjiiJFpPTBha3BpaykKCiAgICBGb3IgZXhhbXBsZSwgdGhlIHN1bSBvZiBhbGwgb2YgdGhlIGZhY3RvcnMgb2YgMTIwPTIz4ouFM+KLhTUgaXMKICAgICAgICAoMSsyKzIyKzIzKSgxKzMpKDErNSk9MTXii4U04ouFNj0zNjAKICAgICovCgogICAgbG9uZyBsb25nIHN1bSA9IDE7CgogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBmYWN0b3JTaXplOyBpKyspewogICAgICAgIGlmIChmYWN0b3JzW2ldID09IDApe2NvbnRpbnVlO30KICAgICAgICBpbnQgbiA9IGZhY3RvcnNbaV0rMTsKICAgICAgICBsb25nIGxvbmcgU24gPSAocG93KGksIG4pIC0gMSkvKGktMSk7CiAgICAgICAgc3VtICo9IFNuOwogICAgfQogICAgY291dCA8PCBzdW0gPDwgZW5kbDsKfQ==