#include <bits/stdc++.h>
using namespace std;
int n, i, j, q, a[100001], x, p, A[100005] = {0};
int main() {
  int s;
  scanf("%d", &n);
  q = sqrt(n);
  for (i = 2; i <= q; i++) {
    if (A[i] == 0) {
      for (j = i + i; j <= q; j += i) A[j] = 1;
    }
  }
  A[0] = 1;
  A[1] = 1;
  s = n;
  x = n;
  j = 0;
  while (x % 2 == 0) {
    x = x / 2;
    j++;
    a[j] = 2;
  }
  for (i = 3; i <= q; i += 2) {
    if (A[i] == 0) {
      while (x % i == 0) {
        x = x / i;
        j++;
        a[j] = i;
      }
    }
  }
  if (x > 1) {
    j++;
    a[j] = x;
  }
  x = n;
  for (i = 1; i <= j; i++) {
    x = x / a[i];
    s += x;
  }
  printf("%d\n", s);
  return 0;
}
