#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, temp, m;
  cin >> n;
  m = n;
  temp = n;
  int result = n;
  bool b = false;
  while (temp != 1) {
    for (int i = 2; i <= sqrtf(temp); i++) {
      if (temp % i == 0) {
        result += temp / i;
        temp /= i;
        b = true;
        break;
      }
    }
    if (b == false) {
      result += 1;
      break;
    }
    b = false;
  }
  cout << result << endl;
  return 0;
}
