#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  long a, ans = 0;
  scanf("%ld", &a);
  ans += a;
  for (long i = 2; i * i <= a; i++) {
    while (a % i == 0) {
      ans += a / i;
      a /= i;
    }
  }
  if (a != 1) ans += 1;
  printf("%ld\n", ans);
  return EXIT_SUCCESS;
}
