#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-5;
const int MODULO = 1000000007;
int main() {
  int n;
  cin >> n;
  int mx = (int)sqrt((double)n) + 1;
  long long ans = 0;
  int i = 2;
  while (n > 1 && i <= mx) {
    while (n % i == 0) {
      ans += n;
      n /= i;
    }
    i++;
  }
  if (n != 1) {
    ans += n + 1;
  } else {
    ans += 1;
  }
  cout << ans << endl;
  return 0;
}
