#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 9;
;
const int MAX1 = 3e8 + 9;
const double pi = acos(-1);
const long long int inf = INT_MAX;
const long long int mod = 1e9;
int main() {
  int n;
  cin >> n;
  int sum = 1;
  for (int i = 2; i <= n; i++) {
    if (i * i > n) break;
    while (n % i == 0) {
      sum = sum + n;
      n = n / i;
    }
  }
  if (n > 1) sum = sum + n;
  cout << sum;
}
