#include <bits/stdc++.h>
using namespace std;
int num(int n) {
  int ret = 0;
  int k = 2;
  while (k * k <= n) {
    while (n % k == 0) {
      n /= k;
      ret += n;
    }
    ++k;
  }
  ret += (n > 1);
  return (ret);
}
int n;
int main() {
  scanf("%d", &n);
  cout << n + num(n) << endl;
  return 0;
}
