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