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