#include using ll = long long; using namespace std; ll tinh(ll n) { ll ok=1, i=2, s; while(i*i<=n) { if(n%i==0) { s = i; while(n%i==0) {n/=i; s*=i;} ok = ok*(s-1)/(i-1); } ++i; } if(n>1) ok = ok*(n*n-1)/(n-1); return ok; } ll n; int main() { cin.tie(0)->sync_with_stdio(0); cin >> n; cout << tinh(n); return 0; }