#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  ;
  int r = 1 + n;
  int i, t;
  while (n > 1) {
    t = 1;
    for (i = 2; i * i <= n; i++)
      if (n % i == 0) {
        t = n / i;
        break;
      }
    if (t == 1) break;
    r += t;
    n = t;
  }
  cout << r;
  return 0;
}
