#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, S = 0, b;
  cin >> n;
  b = n;
  S = b;
  vector<int> seive(n, 1);
  for (int i = 2; i <= n; i++) {
    if (seive[i - 1] == 1) {
      for (int j = i * i; j <= n; j += i) {
        seive[j - 1] = 0;
      }
      while (1) {
        if (b % i == 0) {
          b = b / i;
          S += b;
        } else
          break;
      }
      if (b == 1) {
        break;
      }
    }
  }
  cout << S;
}
