#include <bits/stdc++.h>
using namespace std;
static const int INF = 500000000;
template <class T>
void debug(T a, T b) {
  for (; a != b; ++a) cerr << *a << ' ';
  cerr << endl;
}
int main() {
  int n;
  scanf("%d", &n);
  long long int res = n;
  for (int i = 2; i * i <= n; ++i) {
    while (n % i == 0) {
      n /= i;
      res += n;
    }
  }
  if (n > 1) res += 1;
  cout << res << endl;
  return 0;
}
