#include <bits/stdc++.h>
using namespace std;
bool isprime(int n) {
  if (n == 2) {
    return 1;
  }
  if (n == 1 || n == 0 || n % 2 == 0) {
    return 0;
  }
  for (int i = 3; i * i <= n; i += 2) {
    if (n % i == 0) {
      return 0;
    }
  }
  return 1;
}
int gcd(int a, int b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
int lcm(int a, int b) { return a * b / gcd(a, b); }
long long int BiggestDivisor(int a) {
  for (int i = 2; i * i <= a; i++) {
    if (a % i == 0) {
      return (a / i);
    }
  }
  return 0;
}
int main() {
  long long int n, sum = 0;
  cin >> n;
  long long h = n;
  while (h != 0) {
    h = BiggestDivisor(h);
    sum += h;
  }
  cout << sum + 1 + n;
  return 0;
}
