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