#include <bits/stdc++.h>
using namespace std;
const long long int inf = (long long int)1e18 + 19;
const long long int mod = (long long int)1e9 + 7;
void cazz() {
  long long int t = 1, i, j, n;
  cin >> n;
  long long int ans = n;
  for (i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      n /= i;
      ans += n;
    }
  }
  if (n > 1) ans++;
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  cazz();
  return 0;
}
