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