import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines from math import gcd from functools import reduce from operator import mul def MillerRabinTest(n, maxiter = 10): import random if n == 1: return False elif n == 2: return True if not n&1: return False d = n - 1 while not (d & 1): d >>= 1 for _ in range(maxiter): a = random.randint(1,n-1) t = d x = pow(a,t,n) while (t != n-1) and (x != 1) and (x != n - 1): x = x * x % n t <<= 1 if (x != n-1) and not (t & 1): return False return True U = 10 ** 5 pf = list(range(U)) for n in range(2,U,2): pf[n] = 2 sq = int(U ** .5) + 1 for p in range(3,sq,2): if pf[p] == p: for i in range(p*p,U,p+p): pf[i] = p def pollard_rho(n): f = 0 while True: f += 1 x, y = 2, 2 while True: x = (x*x + f) % n y = (y*y + f) % n y = (y*y + f) % n d = gcd(x - y, n) if d != 1: break if d == n: continue return d def _factor(N): if N == 1: return while N != 1: if N < U: p = pf[N] yield p; N //= p continue if MillerRabinTest(N,maxiter=15): yield N return d = pollard_rho(N) for x in _factor(d): yield x N //= d def factor(N): f = list(_factor(N)) f.sort() return f N = int(read()) f = factor(N) se = set() for p in f: if p not in se: se.add(p) else: se.remove(p) answer = reduce(mul,se,1) print(answer)