#include <bits/stdc++.h>
using namespace std;
bool issquare(int n) {
  int sq = sqrt(n);
  if (sq * sq == n) {
    return true;
  } else {
    return false;
  }
}
int main() {
  long long int n;
  cin >> n;
  long long int ans = n;
  int f = 1;
  while (n != 1 and f == 1) {
    int sqr = ceil(sqrt((n * 1.0)));
    f = 0;
    for (int i = 2; i <= sqr; i++) {
      if (n % i == 0) {
        n = n / i;
        ans += n;
        f = 1;
        break;
      }
    }
  }
  if (n != 1) ans += 1;
  cout << ans << endl;
}
