#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
bool is_prime(long long n) {
  if (n == 1) return true;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
void problem_solver() {
  long long n;
  cin >> n;
  long long ans = n + 1;
  while (!is_prime(n)) {
    for (long long i = 2; i * i <= n; i++) {
      if (n % i == 0) {
        ans += (n / i);
        n /= i;
        break;
      }
    }
  }
  cout << ans;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int t = 1;
  while (t--) {
    problem_solver();
    cout << "\n";
  }
}
