#include <bits/stdc++.h>
using namespace std;
long long n, m, k, a[100005];
int primo[100005];
vector<int> primos;
void criba(int n) {
  for (int i = 2; i < n; ++i) primo[i] = 1;
  for (int i = 2; i * i < n; i++)
    if (primo[i])
      for (int j = i * i; j < n; j += i) primo[j] = 0;
  for (int i = 2; i < n; ++i) {
    if (primo[i]) primos.push_back(i);
  }
}
long long gcd(long long a, long long b) {
  if (a < b) swap(a, b);
  return a % b == 0 ? b : gcd(b, a % b);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  long long ans = n;
  while (n > 1) {
    int ok = 0;
    for (long long i = 2; i * i <= n; i++) {
      if (n % i == 0) {
        n /= i;
        ans += n;
        ok = 1;
        break;
      }
    }
    if (!ok) {
      ans++;
      break;
    }
  }
  cout << ans;
  return 0;
}
