#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout << fixed;
  cout.precision(10);
  int n;
  cin >> n;
  int ans = n;
  for (int i = 2; i <= sqrt(n); i++) {
    while (n % i == 0) {
      ans += n / i;
      n /= i;
    }
  }
  if (n != 1) ans++;
  cout << ans;
  return 0;
}
