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