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