#include <bits/stdc++.h>
int main() {
  int n, s, d;
  scanf("%d", &n);
  s = n;
  while (n > 1) {
    d = n - 1;
    while (n % d != 0) d--;
    s += d;
    n = d;
  }
  printf("%d", s);
  return 0;
}
