#include <bits/stdc++.h>
using namespace std;
const int SIZE = 40000;
int primes[SIZE];
bool ptable[SIZE];
int total;
int ps[SIZE];
int fs[SIZE];
int main() {
  for (long long int i = 2; i < SIZE; i++)
    if (!ptable[i]) {
      primes[total++] = i;
      for (long long int j = i * i; j < SIZE; j += i) ptable[j] = true;
    }
  int N;
  scanf("%d", &N);
  int ans = N;
  for (int i = 0; i < total; i++)
    while (N % primes[i] == 0) {
      N /= primes[i];
      ans += N;
    }
  if (N > 1) ans++;
  printf("%d\n", ans);
  return 0;
}
