#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
int main() {
  int i, n, sum;
  while (scanf("%d", &n) != EOF) {
    sum = 0;
    while (n != 1) {
      sum += n;
      for (i = 2; i <= n; i++) {
        if (n % i == 0) {
          n /= i;
          break;
        }
      }
    }
    cout << sum + 1 << endl;
  }
  return 0;
}
