#include <bits/stdc++.h>
using namespace std;
long long INF = 9999999999;
double EPSILON = 0.00000001;
int sint(string s) {
  int num = 0;
  istringstream myStream(s);
  (myStream >> num);
  return num;
}
string str(int num) {
  ostringstream oss;
  oss << num;
  return oss.str();
}
vector<string> split(string s) {
  vector<string> tokens;
  stringstream os(s);
  string temp;
  while (os >> temp) {
    tokens.push_back(temp);
  }
  return tokens;
}
int maxv(vector<int> v) {
  int m = -9999999;
  for (int i = 0; i < v.size(); i++) m = max(m, v[i]);
  return m;
}
int minv(vector<int> v) {
  int m = 9999999;
  for (int i = 0; i < v.size(); i++) m = min(m, v[i]);
  return m;
}
int main() {
  long long n;
  cin >> n;
  long long s = 0;
  while (n != 1) {
    s += n;
    long long root = sqrt(n);
    bool found = false;
    for (long long r = 2; r <= root; r++) {
      if (n % r == 0) {
        n /= r;
        found = true;
        break;
      }
    }
    if (not found) n = 1;
  }
  cout << s + 1 << "\n";
  return 0;
}
