#include <bits/stdc++.h>
using namespace std;
int prime[32000], v;
bool flag[32000];
void seive() {
  int i, j;
  memset(flag, false, sizeof(flag));
  for (i = 2; i <= 32000; ++i) {
    if (flag[i] == false) {
      for (j = i + i; j <= 32000; j += i) {
        flag[j] = true;
      }
    }
  }
  v = 0;
  for (i = 2; i <= 32000; i++)
    if (flag[i] == false) prime[v++] = i;
  return;
}
int main() {
  int i, j, m, n, ans;
  seive();
  while (scanf("%d", &n) == 1) {
    m = 0;
    int flg = 1;
    ans = n;
    while (flg && n > 1) {
      flg = 0;
      for (i = 0; i <= 3431; i++) {
        if (n % prime[i] == 0) {
          flg = 1;
          ans += (n / prime[i]);
          n /= prime[i];
          break;
        }
      }
      if (flg == 0) {
        ans += 1;
        break;
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
