#include #include #include #include #include #include #include #include #include #include #include using ll = long long; using namespace std; int main() { ll n, fac=3; cin >> n; while (fac*fac <= n){ if (!(n%fac)){ cout << fac << endl; return 0; } if (!(n%fac)) n /= fac; else fac++; } if (n == 4) cout << 4 << endl; else if (!(n%2)) cout << n/2 << endl; else cout << n << endl; }