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