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