#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10, inf = 1e10;
int n, m[110][110], good[110][110];
int main() {
  cin >> n;
  int sum = n;
  while (n > 1) {
    bool isdiv = false;
    for (int d = 2; d * d <= n; d++)
      if (n % d == 0) {
        n /= d;
        isdiv = true;
        break;
      }
    if (isdiv)
      sum += n;
    else
      break;
  }
  sum++;
  cout << sum << '\n';
  return 0;
}
