#include <bits/stdc++.h>
using namespace std;
int n, res, ctr;
int main() {
  scanf("%d", &n);
  res += n;
  while (n > 1) {
    ctr = 2;
    while (ctr * ctr <= n) {
      if (n % ctr == 0) break;
      ctr++;
    }
    if (n % ctr == 0) {
      n /= ctr;
    } else {
      n = 1;
    }
    res += n;
  }
  printf("%d\n", res);
}
