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