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