#include using namespace std; typedef long long ll; #define F first #define S second #define pii pair #define eb emplace_back #define all(v) v.begin(), v.end() #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep3(i, l, n) for (int i = l; i < (n); ++i) #define sz(v) (int)v.size() #define inf (int)(1e9+7) #define abs(x) (x >= 0 ? x : -(x)) #define ceil(a, b) a / b + !!(a % b) template inline void chmin(T1 &a, T2 b) { if (a > b) a = b; } template inline void chmax(T1 &a, T2 b) { if (a < b) a = b; } template T pow(T a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; } template T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); } // 約数の列挙 O(√n) template vector all_divisor_catch(T n) { vector res; for (T i = 1; i * i <= n; i++) { if (n % i == 0) { res.push_back(i); if (i != n / i) res.push_back(n / i); } } return res; } int main() { ll n; cin >> n; auto v = all_divisor_catch(n); // rep(i, sz(v)) cout << v[i] << " "; cout << endl; ll ans = 0; rep(i, sz(v)) ans += v[i]; cout << ans << endl; }