#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, g;
  vector<int> factors;
  cin >> n;
  g = n;
  i = 2;
  while (n != 1) {
    while (n % i == 0) {
      factors.push_back(i);
      n /= i;
    }
    i++;
  }
  n = g;
  int answer = n;
  for (i = 0; i < factors.size(); i++) {
    answer += n / factors[i];
    n /= factors[i];
  }
  cout << answer << endl;
  return 0;
}
