#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, k;
  cin >> n;
  int c1 = n;
  for (i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      while (n % i == 0) {
        n /= i;
        c1 += n;
      }
    }
  }
  if (n > 1) {
    c1++;
  }
  cout << c1 << endl;
  return 0;
}
