#include <bits/stdc++.h>
using namespace std;
long long n, ans, k, p;
int main() {
  cin >> n;
  k = 2;
  while (n > 1) {
    ans += n;
    k = 2;
    p = (long long)sqrt(n) + 1;
    for (k = 2; k <= p; k++) {
      if (n % k == 0) {
        n /= k;
        break;
      }
    }
    if (k == (p + 1)) n = 1;
  }
  cout << ans + 1 << endl;
}
