#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > del;
void phi(int n) {
  for (int i = 2; i * i <= n; ++i)
    if (n % i == 0) {
      del.push_back(make_pair(i, 0));
      while (n % i == 0) {
        n /= i;
        ++del[del.size() - 1].second;
      }
    }
  if (n > 1) del.push_back(make_pair(n, 1));
}
int main() {
  int N;
  cin >> N;
  phi(N);
  int cer = N;
  for (int i = 0; i < del.size(); ++i) {
    for (int k = 0; k < del[i].second; ++k) {
      cer += N / del[i].first;
      N = N / del[i].first;
    }
  }
  cout << cer;
  return 0;
}
