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