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