#include #include #include #define rep( i, n, m ) for (int i = ( n ); i < ( m ); i++) #define rep_d( i, n, m ) for (int i = ( n ); i < ( m ); i--) typedef unsigned long long lint; int main( void ){ lint n; std::cin >> n; if (n == 1){ printf( "1\n" ); return 0; } lint sum = 1 + n; lint max = std::sqrt( n ) + 1; lint a; for(lint i = 2; i < max; i++){ a = ( lint )( n / i ); if (n - i * a == 0){ sum += i + a; if (i == max - 1) sum -= max - 1; } } std::cout << sum << std::endl; return 0; }