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