#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, r = 0, f;
  cin >> n;
  while (n > 1) {
    r += n;
    f = 0;
    for (int i = 2; i * i <= n; ++i)
      if (n % i == 0) {
        n /= i;
        f = 1;
        break;
      }
    if (!f) n = 1;
  }
  cout << r + 1;
  return 0;
}
