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