#include <bits/stdc++.h>
using namespace std;
bool simp(long long n) {
  if (n == 2) return true;
  if (n % 2 == 0) return false;
  long double s = n;
  for (int i = 3; i <= sqrt(s); i += 2) {
    if (n % i == 0) return false;
  }
  return true;
}
int main() {
  long long n, t;
  cin >> n;
  if (simp(n)) {
    cout << n + 1;
    return 0;
  }
  long long i = 2;
  long long j = 0;
  long double s = n;
  vector<long long> a(ceil(sqrt(s)) + 1);
  while (n > 1) {
    while (n % i == 0) {
      a[j] = i;
      j++;
      n /= i;
    }
    i++;
  }
  long long ans = 0;
  long long pr = 1;
  for (int k = 0; k < j; k++) {
    for (int x = j - 1; x >= k; x--) pr *= a[x];
    ans += pr;
    pr = 1;
  }
  ans++;
  cout << ans;
  cin >> t;
  return 0;
}
