#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int inf = 1e18 + 1;
bool sortbyse(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
long long fn(long long n) {
  if (n % 2 == 0) return 2;
  for (long long i = 3; i <= sqrt(n); i++) {
    if (n % i == 0) return i;
  }
  return n;
}
void solve() {
  long long n, mn = INT_MAX, a, b, ans = 0;
  cin >> n;
  while (n > 1) {
    ans += n;
    n = n / fn(n);
  }
  cout << ans + 1;
}
int32_t main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int q;
  q = 1;
  while (q--) {
    solve();
    cout << endl;
  }
  return 0;
}
