#include <bits/stdc++.h>
using namespace std;
long long int a[9000001 + 1] = {0};
void prime_sieve() {
  a[0] = 0;
  a[1] = 0;
  a[2] = 1;
  for (long long int i = 3; i <= 9000001; i = i + 2) a[i] = 1;
  for (long long int i = 3; i <= 9000001; i = i + 2) {
    if (a[i] == 1) {
      for (long long int j = i * i; j <= 9000001; j = j + i) a[j] = 0;
    }
  }
}
bool isprime(long long int n) {
  if (n < 2) return false;
  for (int i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) return false;
  }
  return true;
}
int main() {
  prime_sieve();
  long long int n, m, j, x, y, i, k, t, len, z;
  cin >> n;
  long long int sum = 0;
  while (n != 0) {
    sum = sum + n;
    if (isprime(n)) break;
    for (i = 2; i <= sqrt(n); i++) {
      if (n % i == 0) {
        n = n / i;
        break;
      }
    }
  }
  cout << sum + 1;
}
