#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int sum = 0;
  int n;
  cin >> n;
  sum += n + 1;
  for (int i = 2; i < sqrt(n) + 1 && i != 1; i++) {
    while (n % i == 0) {
      if (n / i != 1) sum += n / i;
      n /= i;
    }
  }
  cout << sum << endl;
  return 0;
}
