#include #define int long long using namespace std; signed main() { int N; cin >> N; int ans = 0; for( int i = 1; i <= N/2+1; i++ ){ if( N % i == 0 ){ ans += i; } } cout << ans + N << endl; }