#include <bits/stdc++.h>
using namespace std;
const int N = 110000;
long long n;
long long ans;
int main() {
  cin >> n;
  for (int i = 2; i <= n; i++) {
    while (n % i == 0) {
      ans += n;
      n /= i;
    }
  }
  if (n != 1) {
    ans += n;
  }
  ans++;
  cout << ans;
}
