#include <bits/stdc++.h>
using namespace std;
const unsigned long long N_max = 1000000007;
int main() {
  int n;
  cin >> n;
  unsigned long long sum = n;
  for (int i = 2; i <= sqrt((double)n);) {
    if (n % i == 0) {
      n = n / i;
      sum += n;
    } else {
      i++;
    }
  }
  sum++;
  cout << sum << endl;
  return 0;
}
