#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, M, i, j, A[10000], C = 1;
  bool b = true;
  A[1] = 2;
  for (i = 3; i <= 32000; i++) {
    b = true;
    for (j = 2; j <= sqrt(float(i)); j++) {
      if (i % j == 0) {
        b = false;
        break;
      }
    }
    if (!b) continue;
    C++;
    A[C] = i;
  }
  cin >> N;
  M = N;
  for (i = 1; i <= C; i++) {
    while (N % A[i] == 0) {
      N = N / A[i];
      M += N;
    }
  }
  if (N > 1) M++;
  cout << M;
}
