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