#include <bits/stdc++.h>
using namespace std;
bool isSimple(long long n) {
  for (long long i = 2; i <= sqrt(n); ++i) {
    if (n % i == 0) return false;
  }
  return true;
}
int min_delim(long long n) {
  long long min = n;
  for (long long i = 2; i < n; ++i) {
    if (n % i == 0) {
      if (i < min) {
        min = i;
        break;
      }
    }
  }
  return min;
}
int main(void) {
  long long n, sum;
  cin >> n;
  sum = n;
  while (n > 1) {
    if (isSimple(n)) {
      sum++;
      break;
    } else {
      long long tmp = min_delim(n);
      n = n / tmp;
      sum += n;
    }
  }
  cout << sum;
  return 0;
}
