#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair pi; typedef pair pl; int main() { ll X; cin >> X; double sq = sqrt(X); ll sq_i = sq; if (sq == (double)sq_i) { cout << 1 << endl; return 0; } ll x = X; int m = 2,cnt = 0; ll ans = 1; for (ll i = 1; i <= sqrt(X); i++) { if (X % m == 0) { X /= m; cnt++; } else { if (cnt != 0 && cnt % 2 != 0) { ans *= m; } cnt = 0; m++; } } if (cnt % 2 != 0)ans *= m; sq = sqrt(ans * x); sq_i = sq; if (sq != (double)sq_i) { ans *= X; } cout << ans << endl; return 0; }