#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9;
const long long INF64 = (long long)1e18;
const long double EPS = 1e-7;
int main() {
  int n;
  scanf("%d", &n);
  int ans = n;
  for (int i = 2; i * i <= n; i++) {
    if (!(n % i)) {
      ans += n / i;
      n /= i;
      i = 1;
    }
  }
  ans++;
  printf("%d\n", ans);
  return 0;
}
