#include <bits/stdc++.h>
using namespace std;
int f(int n) {
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      return n / i;
    }
  }
  return n;
}
int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  long long answer = 0;
  while (true) {
    answer += n;
    int next = f(n);
    if (next == n) {
      break;
    }
    n = next;
  }
  answer++;
  cout << answer;
  return 0;
}
