#include <bits/stdc++.h>
using namespace std;
const int oo = (int)(1e9);
const long long OO = (long long)(1e18);
int n, m, k, p[111111], P[111111], pnt;
vector<int> a;
long long s;
void Init() {
  memset(p, 0, sizeof(p));
  ;
  for (int i = 2; i <= 111111; i++)
    if (!p[i]) {
      P[pnt++] = i;
      for (int j = i + i; j <= 111111; j += i) p[j] = 1;
    }
  scanf("%d", &n);
  ;
  s = m = n;
  for (int i = 0; i < pnt; i++) {
    while (n % P[i] == 0) n /= P[i], a.push_back(P[i]);
  }
  if (n > 1) a.push_back(n);
  for (int i = 0; i < a.size(); i++) s += (m /= a[i]);
  cout << s;
}
int main() {
  Init();
  return 0;
}
