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