#include <bits/stdc++.h>
bool pri[33001];
int x[100];
int main() {
  memset(pri, 0, sizeof(pri));
  for (int i = 2; i < 200; i++)
    if (pri[i] == 0)
      for (int j = i * i; j <= 33000; j = j + i) pri[j] = 1;
  int n, m, s, k;
  long long sum;
  while (scanf("%d", &n) == 1) {
    s = 0;
    sum = n;
    k = n;
    m = sqrt(n);
    for (int i = 2; i <= m; i++) {
      while (pri[i] == 0 && k % i == 0) {
        k = k / i;
        x[s] = i;
        s++;
      }
    }
    if (k > m) {
      x[s] = k;
      s++;
    }
    for (int i = 0; i < s; i++) {
      sum = sum + n / x[i];
      n = n / x[i];
    }
    printf("%I64d\n", sum);
  }
  return 0;
}
