#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  long long ans = 0;
  while (true) {
    ans += n;
    bool ok = 0;
    for (int i = 2; i * i <= n; i++) {
      if (n % i == 0) {
        ok = 1;
        n = n / i;
        break;
      }
    }
    if (!ok) break;
  }
  cout << ans + 1;
}
