#include #define ll long long using namespace std; void input(){ #define taskname "" if(fopen(taskname ".inp", "r")){ freopen(taskname ".inp", "r", stdin); freopen(taskname ".out","w",stdout); } } const int N = 1e6; ll tonguoc(ll n){ ll sum =0; for(ll i =1; i*i <=n;++i){ if( n % i == 0){ sum += i; if(i != n/i) sum += n/i; } } return sum; } ll n; int main(){ input(); cin.tie(0)->sync_with_stdio(0); cin >> n; cout << tonguoc(n) << endl; return 0; }