#include <bits/stdc++.h>
using namespace std;
long nod(long a) {
  long b;
  for (b = 2; b * b <= a; b++) {
    if (a % b == 0) return b;
  }
  return a;
}
int main() {
  long s, a, b, i, n, j;
  cin >> n;
  s = n;
  while (n > 1) {
    j = nod(n);
    n = n / j;
    s += n;
  }
  cout << s;
  return 0;
}
