#include <bits/stdc++.h>
using namespace std;
int main() {
  long long res;
  int n, p;
  cin >> n;
  p = 2;
  res = n;
  while (n > 1) {
    while (n % p == 0) {
      n /= p;
      res += n;
    }
    p++;
    if (p * p > n) p = n;
  }
  cout << res << '\n';
  cin.ignore();
  cin.ignore();
  return 0;
}
