#include <bits/stdc++.h>
using namespace std;
int smallest_factor(int n) {
  if (n % 2 == 0)
    return 2;
  else {
    int i = 3;
    while (true) {
      if (n % i == 0) return i;
      i += 2;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  int ans = n;
  while (n >= 1) {
    int x = smallest_factor(n);
    n /= x;
    ans += n;
    if (n == 1) {
      break;
    }
  }
  cout << ans << endl;
}
