#include <bits/stdc++.h>
using namespace std;
int xx[] = {0, 0, 1, -1, 1, -1, 1, -1};
int yy[] = {1, -1, 0, 0, 1, -1, -1, 1};
inline long long MAX(long long a, long long b) { return (a > b) ? a : b; }
inline long long MIN(long long a, long long b) { return (a > b) ? b : a; }
inline double dis(double ax, double ay, double bx, double by) {
  return ((ax - bx) * (ax - bx) + (ay - by) * (ay - by));
}
long long pwr(long long x, long long n) {
  if (n == 0) return 1;
  if (n == 1) return x;
  long long a = pwr(x, n / 2);
  a = a * a;
  if (n % 2) a *= x;
  return a;
}
int main() {
  long long n, i, res;
  cin >> n;
  res = 1;
  while (n != 1) {
    res += n;
    bool flag = false;
    for (i = 2; i * i <= n; i++)
      if (n % i == 0) {
        flag = true;
        n /= i;
        break;
      }
    if (flag == false) n = 1;
  }
  cout << res << endl;
  return 0;
}
