#include <bits/stdc++.h>
using namespace std;
bool isprime[32000];
int main() {
  int n;
  cin >> n;
  for (int i = 2; i < 32000; i++) {
    isprime[i] = true;
  }
  for (int i = 2; i < 180; i++) {
    if (isprime[i]) {
      for (int j = i * i; j < 32000; j += i) {
        isprime[j] = false;
      }
    }
  }
  vector<int> primes;
  for (int i = 2; i < 32000; i++) {
    if (isprime[i]) {
      primes.push_back(i);
    }
  }
  vector<int> divisors;
  for (int i = 0; i < primes.size(); i++) {
    while (n % primes[i] == 0) {
      divisors.push_back(primes[i]);
      n /= primes[i];
    }
  }
  if (n > 1) {
    divisors.push_back(n);
  }
  unsigned long long sum = 0;
  for (int i = 0; i <= divisors.size(); i++) {
    unsigned long long val = 1;
    for (int j = i; j < divisors.size(); j++) {
      val *= divisors[j];
    }
    sum += val;
  }
  cout << sum << endl;
}
