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