#include <bits/stdc++.h>
int main() {
  long long unsigned int n, min = 1;
  std::cin >> n;
  long long unsigned k = n;
  do {
    min = 1;
    for (int i = 2; i <= n / 2; i++) {
      if (n % i == 0) {
        min = i;
        break;
      }
    }
    if (min == 1) {
      break;
    }
    n = n / min;
    k += n;
  } while (min > 1);
  std::cout << k + 1;
}
