#include <bits/stdc++.h>
using namespace std;
int div(int n) {
  int i;
  int ck = 0;
  if (n == 1) return 0;
  for (i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      ck = 1;
      return i;
    }
  }
  if (ck == 0) return 0;
}
int main() {
  int n, i;
  cin >> n;
  int count, t;
  count = n;
  while (1) {
    t = div(n);
    if (t == 0) {
      count += 1;
      break;
    } else {
      n = n / t;
      count += n;
    }
  }
  cout << count << endl;
  return 0;
}
