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