#include <bits/stdc++.h>
using namespace std;
long long min_divider(long long n) {
  if (n % 2 == 0) {
    return 2;
  } else {
    for (int i = 3; i < n + 1; ++i) {
      if (n % i == 0) {
        return i;
      }
    }
  }
}
int main() {
  long long n;
  cin >> n;
  long long ans = n;
  while (n > 1) {
    long long element = min_divider(n);
    ans += n / element;
    n /= element;
  }
  cout << ans;
}
