#include <bits/stdc++.h>
using namespace std;
bool isprime(long long int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long int i = 5; i * i <= n; i += 6) {
    if (n % i == 0 || n % (i + 2) == 0) return false;
  }
  return true;
}
long long int smallestfactor(long long int n) {
  for (long long int i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) {
      long long int x = min(i, n / i);
      return x;
    }
  }
}
int main() {
  long long int n;
  cin >> n;
  long long int ans = 0;
  while (1) {
    ans += n;
    if (isprime(n)) {
      ans++;
      break;
    }
    long long int temp = smallestfactor(n);
    n /= temp;
    if (n == 1) {
      ans++;
      break;
    }
  }
  cout << ans;
}
