#include <bits/stdc++.h>
using namespace std;
bool flag[100100];
int primo[100100], topo;
void gera() {
  for (int i = 0; i < 100000; i++) flag[i] = true;
  for (long long i = 2; i * i < 100000; i++)
    if (flag[i])
      for (long long j = i * i; j < 100000; j += i) flag[j] = false;
  topo = 0;
  for (int i = 2; i < 100000; i++)
    if (flag[i]) primo[topo++] = i;
}
vector<int> fact;
void fatora(int n) {
  fact.clear();
  for (int i = 0; i < topo && primo[i] * primo[i] <= n; i++) {
    while (n % primo[i] == 0) {
      fact.push_back(primo[i]);
      n /= primo[i];
    }
  }
  if (n != 1) fact.push_back(n);
}
int main() {
  gera();
  int n;
  scanf("%d", &n);
  fatora(n);
  long long resp = n;
  for (int i = 0; i < fact.size() && n > 1; i++) {
    n /= fact[i];
    resp += n;
  }
  cout << resp << endl;
  return 0;
}
