#include #include #include #include #include #include #include using namespace std; vector getPrimes(long long n) { vector isPrime(n + 1, true); isPrime[0] = false; isPrime[1] = false; for (long long i = 2; i * i <= n; i++) { if (isPrime[i]) { for (long long j = 2 * i; j <= n; j += i) { isPrime[j] = false; } } } vector primes; for (long long i = 0; i <= n; i++) { if (isPrime[i]) { primes.emplace_back(i); } } return primes; } int main() { long long x; cin >> x; long long rt_x = sqrt(x); auto primes = getPrimes(rt_x); long long y = 1; int idx = 0; vector n_prime(primes.size(), 0); while (x > 1) { if (x % primes[idx] == 0) { n_prime[idx]++; x /= primes[idx]; } else { idx++; } } for (int i = 0; i < n_prime.size(); i++) { if (n_prime[i] % 2 == 1) { y *= primes[i]; } } cout << y << endl; return 0; }