#include <bits/stdc++.h>
using namespace std;
int b[1000010] = {0}, p[1000010 / 2];
int cnt;
void prime() {
  cnt = 0;
  for (int i = 2; i < 1000010; i++) {
    if (!b[i]) {
      p[cnt++] = i;
      for (int j = i * 2; j < 1000010; j += i) b[j] = 1;
    }
  }
}
int main() {
  int n;
  prime();
  while (cin >> n) {
    int sum = n;
    for (int i = 0; i < cnt; i++) {
      while (n % p[i] == 0 && n != 1) {
        n /= p[i];
        sum += n;
      }
      if (n == 1) break;
    }
    if (n > 1) sum += 1;
    cout << sum << endl;
  }
}
