from collections import Counter import math def factorize(n): step = lambda x: 1 + (x << 2) - ((x >> 1) << 1) maxq = int(math.floor(math.sqrt(n))) d = 1 q = n % 2 == 0 and 2 or 3 while q <= maxq and n % q != 0: q = step(d) d += 1 return q <= maxq and [q] + factorize(n // q) or [n] def solve(): X = int(input()) fs = factorize(X) cs = Counter(fs) ans = 1 for k in cs: if cs[k] % 2 == 1: ans *= k print(ans) if __name__ == '__main__': solve()