#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int N = 2000;
int n, k, m;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  long long res = n;
  while (true) {
    int x = -1;
    int y = -1;
    for (int i = 2; i <= sqrt(double(n)); i++) {
      if (n % i == 0) {
        x = i;
        y = n / i;
        if (x > y) swap(x, y);
        break;
      }
    }
    if (x == -1) {
      cout << res + 1;
      return 0;
    }
    n = y;
    res += 1LL * n;
  }
  return 0;
}
