#include <bits/stdc++.h>
using namespace std;
template <class T>
void checkmin(T &t, T x) {
  if (x < t) t = x;
}
template <class T>
void checkmax(T &t, T x) {
  if (x > t) t = x;
}
int n;
int main() {
  vector<int> pl;
  cin >> n;
  long long ans = n;
  for (int i = 2; i * i <= n; i++)
    while (n % i == 0) {
      n /= i;
      ans += n;
    }
  if (n != 1) ans++;
  cout << ans << endl;
}
