#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5;
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  int nn = n;
  long long s = n;
  vector<int> v;
  int j = 2;
  while (n > 1) {
    if (j > sqrt(n)) {
      v.push_back(n);
      break;
    }
    while (n % j == 0) {
      v.push_back(j);
      n /= j;
    }
    j++;
  }
  for (int i = 0; i < v.size(); i++) {
    s = s + nn / v[i];
    nn /= v[i];
  }
  cout << s;
  return 0;
}
