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