#include <bits/stdc++.h>
int main(void) {
  long n;
  long sum = 0;
  int i;
  int call = 0;
  scanf("%li", &n);
  while (n != 1) {
    call = 0;
    for (i = 2; i <= (long)sqrt((double)n); i++)
      if (!(n % i)) {
        call = 1;
        break;
      }
    if (call) {
      sum += n;
      n /= i;
    } else {
      sum += n;
      n = 1;
    }
  }
  printf("%li", sum + 1);
  return 0;
}
