#include <bits/stdc++.h>
int main() {
  int n, d = 2;
  scanf("%d", &n);
  int ans = 0;
  while (n != 1) {
    ans += n;
    while (n % d && d * d <= n) d++;
    if (d * d > n) break;
    n = n / d;
  }
  printf("%d", ans + 1);
}
