#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, sum = 0, c;
  cin >> n;
  while (n > 1) {
    sum += n;
    c = 0;
    for (long long i = 2; i <= sqrt(n); i++) {
      if (n % i == 0) {
        n /= i;
        c = 1;
        break;
      }
    }
    if (c == 0) n = 1;
  }
  cout << sum + 1;
  return 0;
}
