#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  {
    long long n;
    cin >> n;
    set<long long> s;
    long long sum = n, k = n;
    for (long long i = 2; i * i <= k;) {
      if (n % i == 0) {
        n /= i;
        if (n == 1) break;
        s.insert(n);
      } else
        i++;
    }
    for (auto itr = s.begin(); itr != s.end(); itr++) sum += *itr;
    cout << sum + 1 << endl;
  }
  return 0;
}
