#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  vector<bool> prime(100000, true);
  for (long long i = 2; i * i <= 100000; i++) {
    if (prime[i]) {
      for (long long j = i * i; j <= 100000; j += i) {
        prime[j] = false;
      }
    }
  }
  long long n;
  cin >> n;
  vector<int> primes;
  for (int(i) = (2); (i) < (100000); (i++)) {
    if (prime[i]) primes.push_back(i);
  }
  int siz = primes.size();
  long long ans = n, d;
  while (n != 1) {
    bool np = true;
    for (int(i) = (0); (i) < (siz); (i++)) {
      if (n % primes[i] == 0) {
        ans += n / primes[i];
        n /= primes[i];
        np = false;
        break;
      }
    }
    if (np) {
      ans++;
      break;
    }
  }
  cout << ans;
  return 0;
}
