#include <bits/stdc++.h>
using namespace std;
int main() {
  int k;
  double a;
  cin >> a;
  k = a;
  while (1) {
    double i(2);
    for (; i < a; i++) {
      if (a / i == int(a / i)) {
        a = a / i;
        k += a;
        break;
      }
    }
    if (a == i) break;
  }
  cout << k + 1;
  return 0;
}
