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