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