#include <bits/stdc++.h>
using namespace std;
int a[102][102], b[102][102];
int main() {
  long long n, i, j, k, l, x = 0;
  cin >> n;
  k = n;
  l = n;
  while (true) {
    x = 0;
    for (i = l - 1; i >= 2; i--)
      if (l % i == 0) {
        x = i;
        break;
      }
    if (x == 0) {
      cout << k + 1;
      return 0;
    }
    if (!x)
      l--;
    else
      l = x;
    k += l;
  }
}
