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