#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int i = 2;
  int a = n;
  while (n > 1) {
    while (n % i != 0) i++;
    n = n / i;
    a += n;
  }
  cout << a;
  return 0;
}
