#include <bits/stdc++.h>
using namespace std;
int isprime[100];
vector<int> primes;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  for (int i = 0; i < 100; i++) isprime[i] = 1;
  isprime[0] = isprime[1] = 0;
  for (int i = 2; i < 100; i++) {
    if (isprime[i]) primes.push_back(i);
    for (int j = i * i; j < 100; j += i) {
      isprime[j] = 0;
    }
  }
  long long idx = 0;
  long long temp = n;
  long long ans = n;
  while (primes[idx] <= n && idx < 100) {
    while (n % primes[idx] == 0) {
      ans += n / primes[idx];
      n /= primes[idx];
    }
    idx++;
  }
  cout << ans << endl;
  return 0;
}
