#include <bits/stdc++.h>
using namespace std;
const int N = 25;
int main(int argc, char *argv[]) {
  long long n;
  cin >> n;
  long long ans = n;
  while (n > 1) {
    bool ok = false;
    for (long long i = 2; i * i <= n; ++i) {
      if (n % i == 0) {
        ans += n / i;
        n /= i;
        ok = true;
        break;
      }
    }
    if (!ok) {
      ++ans;
      break;
    }
  }
  cout << ans << endl;
  return 0;
}
