#include <bits/stdc++.h>
int main(int argc, char **argv) {
  long count = 0;
  std::cin >> count;
  long sum = 0;
  long tmp;
  long size;
  do {
    sum += (tmp = count);
    size = (count / 2) + 1;
    int offset = (count % 2) ? 2 : 1;
    int start = (count % 2) ? 3 : 2;
    for (long i = start; i < size; i += offset) {
      if (!(count % i)) {
        tmp = i;
        break;
      }
    }
    count /= tmp;
  } while (count != 1);
  std::cout << sum + 1;
  return 0;
}
