#include <bits/stdc++.h>
int main() {
  long long n;
  std::cin >> n;
  long long c = sqrt(n);
  long long out = n;
  for (long long i = 2; i <= c; i++) {
    while (n % i == 0) {
      n = n / i;
      out = out + n;
    }
  }
  if (n > 1) {
    out = out + 1;
  }
  std::cout << out;
  return 0;
}
