#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int took = n;
  int sum = n;
  while (took != 1) {
    for (int i = 2; i <= took; i++)
      if (took % i == 0) {
        took = took / i;
        sum += took;
        break;
      }
  }
  cout << sum << endl;
  return 0;
}
