#include <bits/stdc++.h>
using namespace std;
int min_divisor(int N) {
  if ((N % 2) == 0) return 2;
  for (int i = 3; i <= sqrt(N); i += 2) {
    if ((N % i) == 0) {
      return i;
    }
  }
  return N;
}
int main() {
  int N;
  cin >> N;
  int sum = N;
  int div;
  while (N != 1) {
    div = min_divisor(N);
    N /= div;
    sum += N;
  }
  cout << sum << endl;
  return 0;
}
