#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int A[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47};
  cin >> n;
  int i = 0, s = n;
  while (i < 15 && n > 1) {
    if (n % A[i] == 0) {
      while (n % A[i] == 0) {
        n = n / A[i];
        s += n;
      }
    }
    i++;
  }
  cout << s << endl;
}
