#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, sum = 0;
  int OK;
  cin >> n;
  while (n > 1) {
    OK = 0;
    for (int i = 2; i < 40000; i++) {
      if (n % i == 0) {
        sum += n;
        n /= i;
        OK = 1;
        break;
      }
    }
    if (OK == 0) {
      sum += n;
      break;
    }
  }
  sum += 1;
  cout << sum << endl;
  scanf(" ");
}
