import std.algorithm, std.conv, std.range, std.stdio, std.string; void main() { auto x = readln.chomp.to!long; const pi = primes(nsqrt(x)); long[long] fi; while (x > 1) { auto f = factor(x, pi); ++fi[f]; x /= f; } auto r = 1L; foreach (f, c; fi) if (c % 2) r *= f; writeln(r); } pure T[] primes(T)(T n) { import std.algorithm, std.conv; auto sieve = new bool[]((n + 1) / 2); sieve[] = true; foreach (p; 1..((nsqrt(n) - 1) / 2 + 1)) if (sieve[p]) for (auto q = p * 3 + 1; q < (n + 1) / 2; q += p * 2 + 1) sieve[q] = false; T[] r; foreach (i, s; sieve) if (s) r ~= (i * 2 + 1).to!T; r = 2 ~ r[1..$]; return r; } pure T factor(T)(T n, const T[] pi) { auto ma = nsqrt(n) + 1; foreach (p; pi) if (p > ma) return n; else if (n % p == 0) return p; return n; } pure T nsqrt(T)(T n) { import std.algorithm, std.conv, std.range, core.bitop; if (n <= 1) return n; T m = 1 << (n.bsr / 2 + 1); return iota(1, m).map!"a * a".assumeSorted!"a <= b".lowerBound(n).length.to!T; }