#include <bits/stdc++.h>
using namespace std;
bool pr[1000000 + 1];
int main() {
  for (int i = 2; i <= 1000000; i++) pr[i] = true;
  for (int i = 2; i * 2 <= 1000000; i++)
    if (pr[i])
      for (int j = i + i; j <= 1000000; j += i) pr[j] = false;
  int n;
  cin >> n;
  int c = n;
  for (int i = 2; (i * i <= n) && (n != 1); i++)
    if (pr[i])
      while (n % i == 0) {
        if (n / i != 1) {
          c += n / i;
        }
        n /= i;
      }
  if (n > 0) {
    c += 1;
  }
  cout << c;
  return 0;
}
