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