#include <bits/stdc++.h>
int largediv(int n) {
  int i, j;
  int ret = 1;
  for (i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      ret = i;
      break;
    }
  }
  if (ret != 1) ret = n / ret;
  return ret;
}
int main() {
  int n, sum;
  int i, j, k;
  scanf("%d", &n);
  sum = n;
  while (n != 1) {
    n = largediv(n);
    sum += n;
  }
  printf("%d\n", sum);
  return 0;
}
