#include <bits/stdc++.h>
using namespace std;
const long INF = (long)1e09;
long long n, m, j, k, ans = 0;
int main() {
  cin >> n;
  ans = n;
  while (n > 1) {
    long i;
    for (i = 2; n % i != 0; i++)
      ;
    ans += (n / i);
    n /= i;
  }
  cout << ans;
  return 0;
}
