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