#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n;
  int sum = n;
  int i;
  while (true) {
    m = -1;
    for (i = 2; i <= (int)(sqrt(n) + 1); ++i)
      if (n == n / i * i) {
        m = i;
        break;
      }
    if (m == -1) m = n;
    sum += n / m;
    n = n / m;
    if (n == 1) break;
  }
  cout << sum;
  return 0;
}
