#include <bits/stdc++.h>
using namespace std;
long long n, i, j, k, l, m, arr[200010], x, r, a, b, c, d,
    od = 0, ev = 0, arr1[200010], p, hi, lo, mid, s, y, t, res = 0;
map<long long, long long> mp, mp1;
vector<long long> vc, vc1;
string st, st1;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  res += n;
  for (i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) {
      while (n % i == 0) {
        n /= i;
        if (n > 1) res += n;
      }
    }
  }
  res++;
  cout << res;
}
