#include using namespace std; vector divList(long long n) { vector res; for(long long i = 1; i * i <= n; ++i) { if(n % i == 0) { res.push_back(i); if(i * i != n) res.push_back(n / i); } } sort(res.begin(), res.end()); return res; } int main() { long long n; cin >> n; vector D = divList(n); long long sum = 0; for(auto d : D) sum += d; cout << sum << '\n'; return 0; }