#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, z;
  cin >> n;
  z = n;
  for (int i = 2; i * i <= n; i++)
    while (n % i == 0) n /= i, z += n;
  if (n > 1) z++;
  cout << z << endl;
  return 0;
}
