#include using namespace std; #define REP(i,n) for(int i=0; i<(int)(n); i++) #define FOR(i,b,e) for (int i=(int)(b); i<(int)(e); i++) #define ALL(x) (x).begin(), (x).end() const double PI = acos(-1); vector divisor(long long n) { vector ret; for (long long i = 1; i * i <= n; i++) { if (n % i == 0) { ret.push_back(i); if (i != n / i) ret.push_back(n / i); } } return ret; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); long long n; cin >> n; long long sum = 0; for (long long d : divisor(n)) sum += d; cout << sum << endl; return 0; }