#include #include #include using namespace std; int main(){ long long ans=1,N; map ex; cin >> N; for(int i=2;i<=sqrt(N);i++){ if(N%i==0){ ex[i]++;N/=i;i--; } } if(N!=1){ex[N]++;} for(auto it=ex.begin();it!=ex.end();it++){ ans*=(pow((*it).first,(*it).second+1)-1)/((*it).first-1); } cout << ans << endl; return 0; }