#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long res = n, aux = n;
  while (true) {
    for (long long i = 1; i * i <= n; i++) {
      if (n % i == 0) {
        if (i != 1) {
          aux = i;
          break;
        }
        aux = i;
      }
    }
    if (aux == 1) {
      res++;
      break;
    }
    n = n / aux;
    res += n;
  }
  cout << res;
  return 0;
}
