#include #include #include #include #include #include #include #include #include #include using ll = long long; using namespace std; int main() { ll n, sum1 = 0, i = 2, lim; cin >> n; lim = pow(n, 0.5); while (n>1 && i <= lim){ if (!(n%i)){ n /= i; lim = pow(n, 0.5); sum1 += i; continue; } i++; } if (n != 1) sum1 += n; cout << sum1 << endl; }