#include <bits/stdc++.h>
int main() {
  size_t n;
  std::cin >> n;
  size_t ansv = n;
  while (n != 1) {
    bool flag = false;
    size_t del;
    for (del = 2; del <= (size_t)sqrt(n) + 1; ++del) {
      if (n % del == 0) {
        flag = true;
        break;
      }
    }
    if (!flag) del = n;
    n = n / del;
    ansv += n;
  }
  std::cout << ansv;
  return 0;
}
