#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    long long int ans = 0LL;
    for (;;) {
      ans += n;
      bool div = false;
      for (int i = 2; i * i <= n; ++i) {
        if (n % i == 0) {
          n /= i;
          div = true;
          break;
        }
      }
      if (!div) {
        ++ans;
        break;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
