#include <bits/stdc++.h>
using namespace std;
int main() {
  int number;
  cin >> number;
  long long ans = number;
  while (1) {
    int x = 100000000;
    for (int i = 2; i <= sqrt(number); i++) {
      if (number % i == 0) {
        x = min(x, i);
      }
    }
    if (x == 100000000) break;
    ans += number / x;
    number = number / x;
  }
  cout << ans + 1;
}
