#include <iostream>
using namespace std;
int main() {
long long n, gcd, primeNumInPow, power;
while(cin >> n)
{
gcd = 1;
for(long long i = 2; i * i <= n; i++) {
if(n % i == 0) {
power = 0; primeNumInPow = 1;
while(n % i == 0) {
power++;
primeNumInPow *= i;
n /= i;
}
gcd *= (power + 1)*primeNumInPow - power*primeNumInPow/i;
}
}
if (n > 1) gcd *= (2*n - 1);
cout << gcd << endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwogCmludCBtYWluKCkgewoJbG9uZyBsb25nIG4sIGdjZCwgcHJpbWVOdW1JblBvdywgcG93ZXI7Cgl3aGlsZShjaW4gPj4gbikKCXsKCQlnY2QgPSAxOwoJCWZvcihsb25nIGxvbmcgaSA9IDI7IGkgKiBpIDw9IG47IGkrKykgewoJCQlpZihuICUgaSA9PSAwKSB7CgkJCQlwb3dlciA9IDA7IHByaW1lTnVtSW5Qb3cgPSAxOwoJCQkJd2hpbGUobiAlIGkgPT0gMCkgewoJCQkJCXBvd2VyKys7CgkJCQkJcHJpbWVOdW1JblBvdyAqPSBpOwoJCQkJCW4gLz0gaTsKCQkJCX0KCQkJCWdjZCAqPSAocG93ZXIgKyAxKSpwcmltZU51bUluUG93IC0gcG93ZXIqcHJpbWVOdW1JblBvdy9pOwoJCQl9CgkJfQkJCgkJaWYgKG4gPiAxKSBnY2QgKj0gKDIqbiAtIDEpOwoJCWNvdXQgPDwgZ2NkIDw8IGVuZGw7Cgl9CiAgcmV0dXJuIDA7Cn0=