#include <bits/stdc++.h>
using namespace std;
long long Hash(char* s, int sz) {
  const int p = 31;
  long long hash = 0, p_pow = 1;
  for (size_t i = 0; i < sz; ++i) {
    hash += (s[i] - 'a' + 1) * p_pow;
    p_pow *= p;
  }
  return hash;
}
int gcd(int a, int b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
vector<int> fac;
void Factor(int N) {
  int n = N;
  for (int i = 2; i * i <= N; i++) {
    if (n % i == 0) {
      fac.push_back(i);
      n /= i;
      i--;
    }
  }
  if (n > 1) fac.push_back(n);
  sort(fac.begin(), fac.end());
  fac.push_back(1);
}
int main() {
  int n;
  scanf("%d", &n);
  fac.clear();
  Factor(n);
  int qur = 1;
  long long ans = 0;
  int k = 0;
  while (fac.size() != k) {
    ans += n / qur;
    qur *= fac[k];
    k++;
  }
  printf("%I64d", ans);
  return 0;
}
