#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int primes[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47};
  int sum = 0, prev;
  while (n > 1) {
    sum += n;
    prev = n;
    for (int i = 0; i < 16; i++) {
      if (n % primes[i] == 0) {
        n /= primes[i];
        break;
      }
    }
    if (prev == n) n = 1;
  }
  cout << sum + 1;
  return 0;
}
