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