#include <bits/stdc++.h>
using namespace std;
vector<int> prime;
int n;
int ans;
bool bagi;
void gen() {
  bool in;
  prime.clear();
  prime.push_back(2);
  for (int i = 3; i <= 100000; i++) {
    in = true;
    for (int j = 0; j < prime.size(); j++) {
      if (prime[j] > sqrt(i)) break;
      if (i % prime[j] == 0) {
        in = false;
        break;
      }
    }
    if (in) prime.push_back(i);
  }
}
int main() {
  gen();
  scanf("%d", &n);
  ans = n;
  bagi = true;
  while (bagi && n > 1) {
    bagi = false;
    for (int i = 0; i < prime.size(); i++) {
      if (n % prime[i] == 0) {
        n /= prime[i];
        ans += n;
        bagi = true;
        break;
      }
    }
  }
  if (n > 1) ans++;
  printf("%d\n", ans);
  return 0;
}
