#include <bits/stdc++.h>
using namespace std;
int dp[51];
void calc() {
  for (int i = 2; i < 51; ++i)
    for (int j = 2; j * j <= i; ++j)
      if (i % j == 0) dp[i] = max(dp[i], i / j);
}
int main() {
  calc();
  int n, n2, t = 0;
  scanf("%d", &n);
  n2 = n;
  while (n > 1) {
    t += dp[n];
    n = dp[n];
  }
  printf("%d\n", n2 + t + 1);
}
