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