#include <bits/stdc++.h>
using namespace std;
bool prime[200010];
void prime_factory(int n);
int main() {
  int i, j, k, m, val, t = 0, cnt, test;
  prime_factory(200000);
  int total = 0, primo[200000];
  for (i = 2; i < 200000; i++)
    if (prime[i] == false) primo[total++] = i;
  long long sum = 0, n;
  scanf("%lld", &n);
  sum = n;
  for (i = 0; i < total && primo[i] <= floor(sqrt(n)); i++)
    while (n % primo[i] == 0) n /= primo[i], sum += n;
  if (n > 1) sum++;
  printf("%lld\n", sum);
  return 0;
}
void prime_factory(int n) {
  prime[0] = prime[1] = true;
  int p = floor(sqrt(n));
  for (int i = 2; i <= p; i++) {
    if (prime[i] == true) continue;
    for (int j = i * i; j <= n; j += i) prime[j] = true;
  }
  return;
}
