#include #include using namespace std; using lint=int64_t; int main() { lint N; lint ans=0; cin >> N; for(lint i=1;i*i<=N;i++) { if(N%i==0) { ans+=(i+N/i); if(i==N/i) ans-=i; } } cout << ans << endl; return 0; }