#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long n;
  cin >> n;
  unsigned long a = 2;
  unsigned long res = n;
  while (n > 1) {
    while ((n % a)) ++a;
    n = n / a;
    res += n;
    a = 2;
  }
  cout << res;
  return 0;
}
